PDA

View Full Version : Disable multiple Row selection



prakashkadakol
14 Feb 2012, 11:29 PM
Hi

my grid allowing to select multiple row selection that is once i click on cell and press shift+arrow down button it allows me to select next set of records i wanted to disable this functionality how it can be done,on grid level how to catch keypress events and return false once shift+arrow down button is pressed

Farish
15 Feb 2012, 12:15 AM
try setting "multiSelect: false" on your grid. by default it should be false. Do you set it to true somewhere?

prakashkadakol
15 Feb 2012, 2:57 AM
on the fly how i can change/set this method to grid

vietits
15 Feb 2012, 5:35 AM
You can use setSelectionMode(selMode) with selMode can be 'SINGLE', 'MULTI' or 'SIMPLE':


grid.getSelectionModel().setSelectionMode('SINGLE');

prakashkadakol
15 Feb 2012, 9:46 PM
tried "grid.getSelectionModel().setSelectionMode('SINGLE')" its throwing error in Firefox
grid.getSelectionModel().setSelectionMode is not a function

prakashkadakol
15 Feb 2012, 10:28 PM
this code worked for me

sm: new Ext.grid.RowSelectionModel({singleSelect:true})

vietits
15 Feb 2012, 10:32 PM
You can see document here Ext.selection.Model.setSelectionMode() (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.selection.Model-method-setSelectionMode).