Forum /
Ext JS Community Forums 4.x /
Ext: Q&A /
Unanswered: Loading subset of json into editable combobox in the Grid
Unanswered: Loading subset of json into editable combobox in the Grid
Hi
I am building a grid based on JSON data which is based on the following
var subAccountStore = new Ext.data.JsonStore({
autoLoad: true,
proxy: {
type:'ajax',
url : '/opUI/json/subaccount.action?name="ABC"'
},
fields: ['accountName', 'accountNumber','accountNumbers', 'quantity']
});
and the sample JSON is
[{"accountName":"'ABC'","accountNumber":"123456","quantity":100,"accountNumbers":['12345A','12345B','12345C']},{"accountName":"'XYZ'","accountNumber":"999999","quantity":100,"accountNumbers":['99999A','99999B','99999C']}]
Now I am trying to build grid with editable combo box as one of column
So my code snippet is
columns: [
{
text : 'Account Name',
width : 60,
flex : 3,
sortable : true,
dataIndex: 'accountName'
},
{
text : 'Account Number',
flex : 2,
sortable : false,
dataIndex: ??? ,
editor: new Ext.form.field.ComboBox({
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: ??? ,
lazyRender: true,
listClass: 'x-combo-list-small'
})
},
{
text : 'Quantity',
flex : 2,
sortable : true,
dataIndex: 'quantity',
align : 'right',
editor: {
xtype: 'numberfield',
allowBlank: false,
minValue: 0,
maxValue: 100000
}
}
]
I am not sure how to make each row shows combobox of it's accountNumbers.
I would really appreciate if some one can put me in the right direction.
Thanks
Tharahan
Sencha - Senior Forum Manager
By default the combobox you would need to set a store with it's own data, to get it from the response from the grid, you would need to extend the editing plugin and set the data from the record being edited onto the combobox's store.
Thanks the response.
Can you give me an example for extending the editing plugin?
Thanks
Tharahan
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us