angularjs - ngGrid: Do not select row if certain conditions exist in -
I have the select all checkbox on a ngGrid that works great but I have There is a situation where some situations exist, I do not want to select a particular line. So if I click Select all, he should select all, but where the check fails, this is what I thought it would have to do:
$ scope.gridOptions.before Selection selection = function (line item, event) {angular.forEach (rowItem, function (item) {if (item.entity status == 'accepted') {item.selected = false;} other {item.selected = true; }}); } But this does not seem to work, how do I get it? I tried even after selection. I think the data changes ( selected property), but there is no selection.
Select All button is not something I have added. This is the one that comes with ngGrid when you enable the checkbox - which is in the header.
< Div class = "post-text" itemprop = "text">
You should be able to use the Edit: OK, I see what you need now. You can override the Select All with Defined: $ scope with the example: checkbox header template and you can tie it on a different function.
$ scope.gridOptions = {data: 'myData', showSelectionCheckbox: true, checkbox header template: '& lt; Input class = "ng selection option" type = "checkbox" ng-show = "multi-select" ng -model = "all selected" ng-change = "select all (all selected)" /> '}
$ scope.select All = function (select all) {angular.forEach ($ scope.myData, function (Data, index) {if (! Select all) {$ scope.gridOptions.selectItem (index, false); return;} if (data.status! = 'Accepted') {$ scope.gridOptions.selectItem (index, true );}}); }
Comments
Post a Comment