-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[ui-grid 3.0.0-rc16] Unable to change value of 'enableCellEdit' for a column definition after initial grid load #2240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You've based off a plunker that uses |
I accidentally closed sorry. I will verify this and close if it works. |
So is the answer to the original question to use a "cellEditiableCondition" function...to be able to dynamically change whether a column is editable or not after the initial load? |
Currently there's no way to change editable after initial definition. It is probably another flavour of #1819, so we could look at it there, but if cellEditableCondition works for you then yes you should use it. |
No comment for over 2 weeks, assuming original raiser has resolved their issue. |
Actually, using cellEditableCondition did not work for me (in terms of dynamically changing a column from editable initially, to non-editable there on out). But you did mention I should look at #1819 @PaulL1 Re-opening this. But if you still think I should just check on #1819, please feel free to reclose. |
This worked for me.
|
Can you explain it? I am not clear on this. |
Hello,
I want to be able to allow the user to add a new rows and initialize all of the columns of that row...but certains columns should then become non-editable after initial initialization (particularly, the one composing the key on the database).
Ex:
$scope.columnsSelected = [
{field: 'id', displayName: 'Identifier', enableCellEdit: false},
...
{field: 'startDate', displayName: 'Start Date', type: 'date', enableCellEdit: true, cellFilter: 'date:"dd-MMM-yyyy"'},
}
];
...
}
Without even trying to modify enableCellEdit property on the $scope.columnsSelected[0].enableCellEdit = true....I see an error on the browser.
TypeError: undefined is not a function
at Grid.getColDef (http://localhost:9091/bower_components/angular-ui-grid/ui-grid.js:3636:43)
at Grid.buildColumns (http://localhost:9091/bower_components/angular-ui-grid/ui-grid.js:3733:17)
at dataWatchFunction (http://localhost:9091/bower_components/angular-ui-grid/ui-grid.js:2923:37)
at Object.$watchCollectionAction as fn
at Scope.$digest (http://localhost:9091/bower_components/angular/angular.js:12541:29)
at Scope.$apply (http://localhost:9091/bower_components/angular/angular.js:12806:24)
at done (http://localhost:9091/bower_components/angular/angular.js:8379:45)
at completeRequest (http://localhost:9091/bower_components/angular/angular.js:8593:7)
at XMLHttpRequest.xhr.onreadystatechange (http://localhost:9091/bower_components/angular/angular.js:8532:11)angular.js:10072 (anonymous function)angular.js:7364 (anonymous function)angular.js:12560 Scope.$digestangular.js:12806 Scope.$applyangular.js:8379 doneangular.js:8593 completeRequestangular.js:8532 xhr.onreadystatechange
Is there any way to do this?
This plnkr can be a starting point.
http://plnkr.co/edit/2A7jsaCZvBRu8iV615F1
The text was updated successfully, but these errors were encountered: