I have a grid with a checkbox selection model. I want to preselect the checkboxes based on the data store for grid. Can anyone please help me out?
Asked
Active
Viewed 1,944 times
1 Answers
0
The rows can be selected by using the 'load' event of the store and the 'selectRows' method of the RowSelectionModel object.
var grid = new Ext.grid.GridPanel(...
sm:new Ext.grid.RowSelectionModel(),..);
var store = new Ext.data.JsonStore(...);
store.on('load',function(records){
Ext.each(records,function(record){
//here you construct an array of row numbers in the grid that you want to select, based on the records you just loaded into the store , let the array be 'rows'
grid.getSelectionModel.selectRows(rows);
})
});

Alin Suciu
- 121
- 2