Reputation: 14978
I have an ngGrid with some individual cells (not columns) that I don't want to be edited. In my example plunk I want to not edit the cells where the row and column index are the same.
I tried preventDefault()
, event.stopPropagation()
, and an old fashioned return false;
in my ngGridEventStartCellEdit
but the cell still enters edit mode.
$scope.$on('ngGridEventStartCellEdit', function (event) {
var row = event.targetScope.row.rowIndex;
var col = event.targetScope.col.index - 1;
if (row == col) {
console.log("Not Gonna propagate");
event.preventDefault();
event.stopPropagation();
return false;
}
});
The console.log("Not Gonna propagate");
fires. What am I doing wrong?
Upvotes: 1
Views: 636