Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Callback on cell click in ui-grid

I want to have a callback function which is fired each time when a cell is clicked. Therefore, i was using the following callback:

gridAPI.cellNav.on.navigate($scope, function (newRowCol, oldRowCol)

But the problem with it is that i can't fire that function when the same cell second time is clicked. In order to be fired for this, a different cell should be selected. Thus only-first-click-on-cell is this.

Is there any callback which i can fire on each click?

like image 873
Asqan Avatar asked Dec 24 '22 13:12

Asqan


1 Answers

No, currently there is no any callback for cellClick as far as i see.

The best trick i could write:

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

Cell template on each column:

cellTemplate: '<div>
   <div ng-click="grid.appScope.cellClicked(row,col)" class="ui-grid-cell-contents" title="TOOLTIP">{{COL_FIELD CUSTOM_FILTERS}}</div>
      </div>',
like image 189
Asqan Avatar answered Dec 27 '22 04:12

Asqan