admin管理员组文章数量:1287121
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?
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?
Share Improve this question edited Oct 18, 2015 at 17:00 royhowie 11.2k14 gold badges53 silver badges67 bronze badges asked Oct 18, 2015 at 15:41 AsqanAsqan 4,48912 gold badges62 silver badges103 bronze badges2 Answers
Reset to default 10No, 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>',
Don't use that, it's better to use:
rowTemplate: `
<div
ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid"
ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'"
class="ui-grid-cell"
ng-click="grid.appScope.$ctrl.yourFunction(row)"
ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }"
role="{{col.isRowHeader ? 'rowheader' : 'gridcell'}}"
ui-grid-cell>
</div>`,
本文标签: javascriptCallback on cell click in uigridStack Overflow
版权声明:本文标题:javascript - Callback on cell click in ui-grid - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741251925a2365954.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论