在ui-grid中单击单元格回调

Asq*_*qan 3 javascript angularjs ng-grid angular-ui-grid

我希望有一个回调函数,每次单击一个单元格时都会触发该函数.因此,我使用以下回调:

gridAPI.cellNav.on.navigate($scope, function (newRowCol, oldRowCol)
Run Code Online (Sandbox Code Playgroud)

但问题是,当第二次点击相同的单元格时,我无法触发该功能.为此,应选择不同的单元格.因此,only-first-click-on-cell是这样的.

每次点击都可以触发任何回调吗?

Asq*_*qan 9

不,就目前而言,目前还没有针对cellClick的任何回调.

我能写的最好的技巧:

$scope.cellClicked = function (row, col){
 // do with that row and col what you want
}
Run Code Online (Sandbox Code Playgroud)

每列上的单元格模板:

cellTemplate: '<div>
   <div ng-click="grid.appScope.cellClicked(row,col)" class="ui-grid-cell-contents" title="TOOLTIP">{{COL_FIELD CUSTOM_FILTERS}}</div>
      </div>',
Run Code Online (Sandbox Code Playgroud)