riyaad
24 Nov 2011, 2:53 AM
Hi Sencha People
Is there a way to populate a select field by means of an external json file?
var store = Ext.create('Ext.data.Store', {
model: 'ListItems',
storeId: 'itemStore',
proxy: {
type: 'ajax',
url: 'itemList.json',
reader: {
type: 'json'
}
},
autoLoad: true
});
then doing ...
var item_ddn = new Ext.field.Select({
name: 'item_ddn',
label: 'Items Listed:',
store: store
});
How does one bind the the item_id to the item_name (as in the JSON below) and list it?
JSON code...
[
{
"item_id" : "113",
"item_name" : "Metro Goldwyn Mayer"
},
{
"item_id" : "106",
"item_name" : "M-Net Action"
}
]
**Appreciated**
Is there a way to populate a select field by means of an external json file?
var store = Ext.create('Ext.data.Store', {
model: 'ListItems',
storeId: 'itemStore',
proxy: {
type: 'ajax',
url: 'itemList.json',
reader: {
type: 'json'
}
},
autoLoad: true
});
then doing ...
var item_ddn = new Ext.field.Select({
name: 'item_ddn',
label: 'Items Listed:',
store: store
});
How does one bind the the item_id to the item_name (as in the JSON below) and list it?
JSON code...
[
{
"item_id" : "113",
"item_name" : "Metro Goldwyn Mayer"
},
{
"item_id" : "106",
"item_name" : "M-Net Action"
}
]
**Appreciated**