AngularJS and jqGrid

前端 未结 3 411
执念已碎
执念已碎 2021-02-02 02:35

I\'m trying to find a simple example of integrating jqGrid with the framework of AngularJS (preferably as a directive that hosts the grid). This question was raised in SO jqGrid

3条回答
  •  [愿得一人]
    2021-02-02 02:55

    I cannot comment, so I post it here, it is the continuity of the question.. I'm also checking your github project luacassus, if I can, I will contribute to it. Nice feature, Words Like Jared. As you said, there is an other part of the API I would like to wrappe with Angular, it is the "pager", I managed it this way :

    $scope.config = {
        ...
        rowList:[10,20,30],
        pager: '#pager2',
        sortname: 'id',
        ...
    };
    

    And this in the directive :

    link: function(scope,element,attrs){
                var table;
                scope.$watch('config', function (newValue) {
                    element.children().empty();
                    table = angular.element('
    '); pager = angular.element('
    '); element.append(table); element.append(pager); $(table).jqGrid(newValue); });

    But I would like to get rid fo the ID, entered the hard way here. After that I will try to use the API like you in order to implement the cell/row/navbar editing possible. (To modify the scope data by modifying data inside the grid... if someone has already something...)

提交回复
热议问题