Skip to content

ui.grid.selection: add public api to enableRowHeaderSelection #2855

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
scottmcdonnell opened this issue Feb 26, 2015 · 4 comments
Closed

ui.grid.selection: add public api to enableRowHeaderSelection #2855

scottmcdonnell opened this issue Feb 26, 2015 · 4 comments

Comments

@scottmcdonnell
Copy link

I can toggle multiselect using the api:
$scope.gridApi.selection.setMultiSelect(!$scope.gridApi.grid.options.multiSelect);

but there is no way to toggle the RowHeaderSelection:
$scope.gridApi.selection.setRowHeaderSelection(!$scope.gridApi.grid.options.enableRowHeaderSelection);

changing the gridOptions does not work either.
$scope.gridApi.grid.options.enableRowHeaderSelection = false;

@PaulL1 PaulL1 added this to the Future milestone Feb 27, 2015
@PaulL1
Copy link
Contributor

PaulL1 commented Feb 27, 2015

At present the rowHeader isn't dynamic. Another instance of #1819

@PaulL1
Copy link
Contributor

PaulL1 commented May 27, 2015

I don't think we're planning on allowing the rowHeader for selection to come and go - you set it up front or you don't. If you're not using the rowHeader, you can turn selection on and off dynamically, as demonstrated in the selection tutorial.

@PaulL1 PaulL1 closed this as completed May 27, 2015
@tzhang318
Copy link

Wonder if you can allow the rowHeader to be toggleable, we are struggling to find a way to make this to work.

@Bodmoor
Copy link

Bodmoor commented Jun 6, 2017

You can also toggle the enableRowHeaderSelection by saving the on / off value using angular localstorage.

localStorageService.set('selectionState', true/false);

now, reload the page the grid is on and load the setting:

    var selectionState = localStorageService.get('selectionState');
    if (selectionState != null || selectionState != undefined) {
        gridOptions.enableRowHeaderSelection = selectionState;
    }

the disadvantage is of course having to reload the grid, but being able to toggle this column is great. I use it combined with the save state call, inspired by: http://plnkr.co/edit/LAMZvOkpx6jsD4CWSz04?p=preview

Also, the code samples need to be interpreted to fit your method of loading the gridOptions initially.

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

4 participants