PDA

View Full Version : How to display simple JSON array in combo box



PriyeshShah
5 Jul 2012, 1:25 AM
My JSON output is:

{"result":{"resultList":[{"A","B"......"Z"}]}

How to display this in Combo box

sword-it
5 Jul 2012, 5:59 AM
Hi,
you can use following code for combobox




{
xtype: 'combo'
, fieldLabel: 'Choose City'
, displayField: 'x'
, valueField: 'x'
, trigerAction:'all'
, mode: 'local'
, store: new Ext.data.JsonStore({
data: {
result: {
resultList: [
{
x: 'A',y:'B',z:'C'
}
]
}
}
, root: 'result.resultList'
, fields:['x']
})
}

PriyeshShah
5 Jul 2012, 6:03 AM
thanks for the example.My problem resolved:)