首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

解析靠山JSON构建JsonStore

2012-11-05 
解析后台JSON构建JsonStorevar _store new Ext.data.JsonStore({proxy:new Ext.data.HttpProxy({ //使用

解析后台JSON构建JsonStore
var _store = new Ext.data.JsonStore({
proxy:new Ext.data.HttpProxy({ //使用代理获得data数据
url:"http://..."
}),
fields:['name','sex','age']
});

只要使用了代理必须要load数据
_store.load();
_store.on('load',function(_store){
alert(_store.getCount());
alert(Ext.util.JSON.ecode(_store.getAt(0).data));
alert(_store.getAt(0).get('age'));
});

热点排行
Bad Request.