Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ext js grid remove selection model

I have a situation where I need to dynamically add or remove grids selection model.

Searching the documentation I see that the selection model doesn't have a destroy() method or anything similar. How can I remove or destroy a selection model from a grid in ext js 4.x.?

If this is not possible I still have an option to revert some functionallity and dynamically add the selection model to an already created grid. But I'm also not sure if this is possible.

like image 747
Jacob Avatar asked Jun 17 '26 05:06

Jacob


1 Answers

I'd suggest to disable the selection model instead of destroying it.

You can clear the current selection (deselectAll) and lock the selection model to prevent further selection (setLocked):

selModel.deselectAll();
selModel.setLocked(true);

As you're using a checkbox selection model, you'll also need to hide the corresponding column which is added to the grid:

grid.headerCt.child('gridcolumn[isCheckerHd]').hide();
like image 88
matt Avatar answered Jun 18 '26 18:06

matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!