如何在不使用$ templateCache

时间:2017-02-07 12:46:25

标签: angularjs angular-ui-grid

我有一个ui-grid,它由一个聚合的空行组成。我想删除这个聚合的行。我已经通过使用$ templateCache实现了这一点。但是这个变化正在影响其他任何有ui-grid的页面。所以我想删除没有$ templateCache的聚合行。

1 个答案:

答案 0 :(得分:0)

使用gridApi.grid.registerRowsProcessor并注册了一个行处理器,它根据条件将行可见性设置为false。

$scope.gridApi.grid.registerRowsProcessor(function(rows){
     _.each(rows,function(row){
        if(row.groupHeader == true && row.dispNm == ' '){
             row.visible = false;
        }
     });
    return rows;
},1000);