我正在尝试使用以下代码从商店填充ExtJS网格面板:
app.js
Ext.define('UC', {
extend: 'Ext.data.Model',
fields: ['PMNumber']
});
var ds = Ext.create('Ext.data.Store', {
storeID :'s',
model: 'UC',
proxy: {
type:'ajax',
url:'data.php',
reader: {
type : 'json',
root: "myInventory",
fields: [
{name: 'PMNumber', type: 'int', mapping: 'PMNumber'},
]
}
}
});
Ext.onReady(function()
{
ds.load();
Ext.create('Ext.grid.Panel', {
title: 'Attendanace',
store: Ext.data.StoreManager.lookup('s'),
columns: [
{ int: 'PMNumber', dataIndex: 'PMNumber' }
],
height: 200,
width: 400,
renderTo: document.getElementById('aa')
});
});
data.php在单独调用时以JSON格式返回以下数据
{"myInventory":[{"PMNumber":"2003010001"},{"PMNumber":"2003010002"}]}
我遗失的任何人?
由于