cellEditableCondition not disable cell edit
I'm following the ui-grid tutorial. I want ot disable on certain cell editable with boolean; $scope.gridOptions = { enabledColumnResize: true, multiSelect: false, enableRowSelection: false, enableHighlighting: false }; $scope.gridOptions.columnDefs = [ { name:'name', displayName:'Group Name', enableSorting: false, cellEditableCondition: "row.entity.isGroup", cellTemplate: '
However the cell is always double clickable and editable even for "row.entity.isGroup" false. Using rc-16 now.
Appreciate any help
Is the tutorial working correctly for you - i.e. the tutorial has a column that isn't editable I believe? I suspect it's the way you're defining your cellEditableCondition, have you tried defining it as: cellEditableCondition: row.entity.isGroup?
Yes, tutorial works for me. If I do it like that, browser won't parse and complains cellEditableCondition: row.entity.isGroup I tried to remove ng-if, still doesn't work.
Take a look at this plunker: http://plnkr.co/edit/b0Ro3jAkTyzqQGXeAgvt?p=preview
If you change the value of $scope.editable to true the id column is editable, if you leave it false then the id column is not editable. I suspect you have some sort of syntax error in your code that is causing your parse error.
OK. if I do it like your example, it works. I suspect that if I use cellEditableCondition: "row.entity.isGroup" it somehow didsn't see this value when it's setting editable? $scope.gridOptions.columnDefs = [ { name:'name', enableSorting: false, cellEditableCondition: "row.entity.isGroup", cellTemplate: '
I changed ur plunker above to like this, $scope.gridOptions.columnDefs = [ { name: 'id', cellEditableCondition: "row.entity.isActive", width: '10%' }, ... But then all cells in the first column are editable.
Maybe I shouldn't use it like that way?
All right, I figured it out, it should be like this: cellEditableCondition: function($scope){return $scope.row.entity.isGroup},