PDA

View Full Version : How to pre-checked a CheckboxSelectionModel



beho
2 Dec 2009, 6:10 AM
I have a JSON store like

{"totalCount":54,"
liste":[
{"capabilities":"switch_themes","checked":1},
{"capabilities":"edit_themes","checked":0},...
]}

And a grid like that :


this.sm2 = new Ext.grid.CheckboxSelectionModel({
id:'checked',
dataIndex: 'checked'
});
this.grid_capabilities = new Ext.grid.GridPanel({
id:'button-grid',
store: this.store_capabilities,
root:"liste",
cm: new Ext.grid.ColumnModel([
this.sm2,
{id:'capabilities',header: "Capabilities", sortable: true, dataIndex: 'capabilities'}
]),
sm: this.sm2,

viewConfig: {
forceFit:true
},
columnLines: true,
width:220,
height:250,
frame:false,
title:'Capabilities',
iconCls:'icon-grid',
style:{marginLeft:'15px'}
});
How can i checked the row when checked=1?
Thanks

husniadil
2 Dec 2009, 1:03 PM
Try it (http://mashusni.co.cc/files/extjs-grid/precheck.php)!

Then view source.