我从我的商店加载此数据。任何人都可以解释我如何动态加载数据。通过使用Ajax。如何在extJS网格中获取JSON数据
我的代码
Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields:[ 'name', 'email', 'phone'],
data: [
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }
]
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});
现在的数据,我会提出一些JSON文件。我的问题是如何在extJS网格商店中获取JSON数据。如何重写STORE代码
嗨大卫是指例如与交代此链接: http://stackoverflow.com/questions/10918030/loading-data-from-a-json-file-成,ExtJS的 – Tejas