Мой JsonStore не заполнен. Когда я запускаю код, он запускает запрос, который возвращает json. Когда я проверяю хранилище данных, массив данных пуст.
Чего мне не хватает? Спасибо.
Я определил этот JsonStore:
CCList.ListStore = new Ext.data.JsonStore({
root: 'rows',
idProperty: 'Id',
fields: ['Id', 'Description'],
autoLoad: true,
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: '/costcenters/getjson'
}),
listeners: {
load: function (obj, records) {
Ext.each(records, function (rec) {
console.log(rec.get('Id'));
});
}
}
});
Попытка связать его с этим Ext.List
CCList.listPanel = new Ext.List({
id: 'indexList',
store: CCList.ListStore,
itemTpl: '<div class="costcenter">{Id}-{Description}</div>'
}
});
Мой URL возвращает этот JSON:
{ "rows" : [
{ "Description" : "Jason",
"Id" : "100"
},
{ "Description" : "Andrew",
"Id" : "200"
}
] }