PDA

View Full Version : Wanted to modified Ext.selection.checkboxmodel before load



vijay30487
27 Aug 2015, 1:06 PM
Hi Champs,

I am using Ext.selection.checkboxmodel that displaying checkbox column for me in my grid. Now I wanted few checkbox has been selected by default based on some condition on grid load


selModel: {
selType: 'checkboxmodel',
checkOnly : true,
injectCheckbox : 0 ,
showHeaderCheckbox :false,
listeners: {

}
}

I have used couple of functions like 'renderer' and 'select', but it was not working for me. Really appreciated for any pointer

Thanks,
Vijay

joel.watson
29 Aug 2015, 11:56 AM
Hi--

You can use the selectionModel of the grid (getSelectionModel()) and then select (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.selection.CheckboxModel-method-select)() the records that you'd like. Here's an example:

https://fiddle.sencha.com/#fiddle/t21

Hope it's helpful! Thanks!
Joel

vijay30487
29 Aug 2015, 5:16 PM
thanks a lot Joel, this was perfect. Appreciate your reply

Regards,
Vijay

joel.watson
29 Aug 2015, 5:18 PM
thanks a lot Joel, this was perfect. Appreciate your reply


Sure thing, happy to help!

Thanks
Joel