PDA

View Full Version : How to preselect checkbox selection model based on store data in grid



offshoreteam
9 Apr 2013, 6:00 AM
I am using checkbox selection model in my grid. I am loading grid through server data.
Based on some condition I would like to make some checkboxes selection at time of loading data into grid.

Farish
9 Apr 2013, 6:24 AM
you can select the records when the store is loaded:


store.on('load', function(store, records) {
var selectRecords = new Array();
for(var i=0; i<records.length; i++)
{
if() // check your condition here
selectRecords.push(records[i]);
}
grid.getSelectionModel().select(selectRecords);
});