2016-08-18 33 views
0

我希望當我選擇網格中的所有行不調用事件rowSelectionChangedBatch,我該如何做?如何禁用ui網格事件?

$scope.gridOptions.onRegisterApi: function(gridApi) { 
     gridApi.selection.on.rowSelectionChangedBatch($scope, function() { 
      /* Do something */ 
     }); 
} 

/* More code */ 
function selectAll() { 
    /* After execute this, should not call the event */ 
    $scope.gridApi.selection.selectAllRows(); 
} 

回答

0

selectAll使用觸發$event.stopPropagation();這樣後:

數據-NG點擊= 「grid.appScope.selectAll(); $ event.stopPropagation();」