Skip to content

In contrast to #2170 , how to enable/disable(show hide) Selection column dynamically #2181

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

Closed
sahil-kapoor opened this issue Nov 21, 2014 · 8 comments

Comments

@sahil-kapoor
Copy link

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?

@PaulL1
Copy link
Contributor

PaulL1 commented Nov 22, 2014

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

@PaulL1 PaulL1 added this to the 3.0 milestone Nov 22, 2014
@sahil-kapoor
Copy link
Author

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.

@c0bra c0bra modified the milestones: Future, 3.0 Dec 8, 2014
@c0bra
Copy link
Contributor

c0bra commented Dec 8, 2014

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.

@PaulL1
Copy link
Contributor

PaulL1 commented May 27, 2015

I believe this has now been addressed, selection can be turned on and off.

@PaulL1 PaulL1 closed this as completed May 27, 2015
@PeterRangelov-zz
Copy link

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.

@chandruk4321
Copy link

I have exactly the same issue. Any workaround ?

@tomyam1
Copy link

tomyam1 commented Jul 11, 2018

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;
  }
}

@cscuser
Copy link

cscuser commented May 12, 2021

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

Thanks its working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants