In contrast to #2170 , how to enable/disable(show hide) Selection column dynamically
How should i show or hide the selection column dynamically ie on a button click? I cant set the $scope.gridOption.enableRowHeaderSelection= false on the button click. I can hide the coloumn by hiding it or setting the visibilty to false by the api. Is there any way to hide/show the selection column through api not through grid option?
I'm not clear on your question. When you say you can't set $scope.gridOption.enableRowHeaderSelection= false on a button click, does that mean you need advice on how to set it, or does it mean you're setting it and then it's not doing what you'd expect?
There is no api other than the gridOption (which is itself an API), but it may be that we need to make that option dynamic, so this would be another variant of #1819
Please have a look at http://plnkr.co/edit/e0TxTvCXRRp4cqggoHGd?p=preview What i am trying to do is, when someone clicks on the button , selection column should toggle between show and hide or the selection column check boxes should be enabled or disabled for the whole grid.
Right now grid options like that are not being watched for updates, I don't think. That's someone that's been discussed but I don't think we've landed on a consensus.
I'm going to mark this as an enhancement, and it's probably something we need to address.
I believe this has now been addressed, selection can be turned on and off.
Having the same issue and can confirm this has not been addressed yet, at least as far as I can tell. Initially: $scope.gridOptions.enableRowHeaderSelection = false; Then on button click: $scope.gridOptions.enableRowHeaderSelection = true;
However the UI doesn't update even after grid.refresh(); and notifyDataChange.
I have exactly the same issue. Any workaround ?
It seems there is still not an option to show/hide the row headers columns.
The work around we use it to show/hide the checkboxes by adding/removing a disable-row-selection class to the ui-grid:
.ui-grid.disable-row-selection {
.ui-grid-selection-row-header-buttons {
display: none;
}
}
I'm not clear on your question. When you say you can't set
$scope.gridOption.enableRowHeaderSelection= falseon a button click, does that mean you need advice on how to set it, or does it mean you're setting it and then it's not doing what you'd expect?There is no api other than the gridOption (which is itself an API), but it may be that we need to make that option dynamic, so this would be another variant of #1819
Thanks its working fine