PDA

View Full Version : Ext.grid.CheckboxSelectionModel



boston-george
16 Jun 2011, 7:46 AM
Hy guys,

when i click into CheckBox of grid i receive thsi error in firebug:

this.grid is undefined

var r = Ext.isNumber(index) ? this.grid.store.getAt(index) : index;

this is my code:



function crtGridOrdCompletare(){

var sm = new Ext.grid.CheckboxSelectionModel({
checkOnly: true

});

?
Ext.getCmp('pnlAllCenter').add({

xtype: 'editorgrid',
flex: 1,
id: 'grlOrdCompletare',
columns: [
sm,
{
xtype: 'gridcolumn',
dataIndex: 'F15STAORD',
header: 'Stato<br>Ordine',
sortable: true,
width: 100,
editable: false,
align: 'center',
id: 'clmF15STAORD'

},
{
xtype: 'gridcolumn',
header: 'Tipologia<br>Ordine',
sortable: true,
width: 100,
align: 'center',
dataIndex: 'F15TIPORD',
editable: false,
id: 'clmF15TIPORD'

}

],//chiusura colonne


store : new Ext.data.JsonStore({
storeId: 'strOrdCompletare',
root: 'rootOrdCompletare',
autoLoad: true,
url: '/Project/public/ordini/strordcompletare',
totalProperty: 'totalOrdCompletare',
fields: [
{
name: 'F15STAORD'

},
{
name: 'F15TIPORD'

}


]
}),


});

Ext.getCmp('pnlAllCenter').doLayout();
}




how can i solve it?
thanks

Tim Toady
16 Jun 2011, 8:32 AM
Specify the sm property on your grid. sm: sm

boston-george
17 Jun 2011, 3:14 AM
i've add

selModel: sm,

and now it's work done!
thanks a lot!!