PDA

View Full Version : GridPanel and checkbox



strad84
10 Feb 2012, 3:22 AM
Hi i've a gridpanel with checkbox, how can i select a checkbox from a dynamic store? thank you. i'm going mad !!!

mitchellsimoens
10 Feb 2012, 4:42 AM
That field should be bool... true will check it and false will uncheck it. Look at the grid/row-editing.html example.

strad84
10 Feb 2012, 5:16 AM
the checkbox column is built inside the gridcolumn, is not a custom column. i push the data into the store and it works fine but i've to push checkbox values too but i don't understand ho how to assign this value to check column. Thank you


xtype: 'gridpanel',
itemId: 'panelEsportazioni',
id:'panelEsportazioni',
title: 'Esp',
store: eDati,
anchor: '100%',
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'nome',
text: 'listaValori'
}
],
viewConfig: {
},
selModel: Ext.create('Ext.selection.CheckboxModel', {
})

mitchellsimoens
10 Feb 2012, 5:19 AM
As I said, the field value needs to be bool. So your nome field should have type : 'bool' and if you return a truthy value it will be true and the checkbox will be checked.

strad84
10 Feb 2012, 5:24 AM
my nome field is a string and i've to display it and i've to check automatically from store. I've both value, a boolean and a string, but whit this check column built inside the grid panel i don't know how assign the bool value.