BKS Saha

BKS Saha

  • NA
  • 44
  • 18.8k

How to store jsondata in combobox ?

Mar 13 2018 6:10 AM
 I have already got data, but how i assign data load in combo box.
 
 
items: [
{
xtype: 'label',
text: 'Country',
style: 'width: 90px'
},
{
xtype: 'combo',
id: 'cmblocation',
width: 211,
displayField: 'name',
valueField: 'id',
store: land,
emptyText: 'Select Location',
allowBlank: false,
listeners: {
afterrender: function () {
Ext.Ajax.request({
url: 'http://localhost:58316/Test.asmx/GetAll',
method: 'GET',
headers: { 'Content-Type': 'application/json' },
success: function (response) {
var data = Ext.decode(Ext.decode(response.responseText).d);
land: new Ext.data.JsonStore({
data: data,
fields: ['Id', 'Name']
//console.log(data);
})
}
})
}
}
}
]
}],

Answers (1)