views:

836

answers:

1

Hello,

I have an EditorGridPanel with a CheckboxSelectionModel. In the Ext.data.Source binded to this grid, I have a boolean value saying if the Checkbox of the rows should be checked by default or now.

How can I have a list that appears by default with the default Checkbox values correctly set, this based on the data value ?

Thanks in advance,

CB

+1  A: 

Assuming you meant Ext.data.Store, you can do it by passing a filtered version of the store as the first parameter to CheckboxSelectionModel.selectRecords, preferably in the EditorGridPanel's show event:

panel.addListener('show', function() {
  this.getSelectionModel().selectRecords(this.getStore().filter('isset', 'true');
});
TML