PDA

View Full Version : Ext.grid.CheckboxSelectionModel() and disabling rows



bcamp1973
17 Jul 2008, 10:54 AM
is there a way to "disable" a row so it can't be selected when using Ext.grid.CheckboxSelectionModel? I would like to disable a row if a specific cell in the grid contains a specified value...i tried adding a renderer to the Ext.grid.CheckboxSelectionModel but no luck...

devnull
17 Jul 2008, 11:22 AM
your best bet is probably a beforerowselect listener on the column model which looks at a specific field in the record for that row and cancels the select if you dont want it selected. you would probably also want to combine this with a getRowClass override in the gridView to give a visual clue as to which rows are not selectable.

bcamp1973
18 Jul 2008, 8:34 AM
Thanks for the tip! That lead me to this post and solved everything for me...

http://extjs.com/forum/showthread.php?t=37354&highlight=beforerowselect