PDA

View Full Version : newbie question: CheckboxSelectionModel



raj_plays
20 Oct 2010, 11:16 PM
Hi,
My grid is configured with a CheckboxSelectionModel.
Can I set the dataIndex of the CheckboxSelectionModel to a boolean column in my Record and expect the records to be checked or unchecked accordingly?

Or need I must write a on load function on my store and call grid.getSelectionModel().selectRecords?

steffenk
20 Oct 2010, 11:46 PM
the second. like this in the load handler:

var a = [];
for (var i=0; i<records.length; i++) {
if(records[i].data.selected) {
a.push(records[i]);
}
}
langSm.selectRecords(a);
where langSm is the selectionModel

raj_plays
21 Oct 2010, 12:11 AM
Danke, Steffen