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'));
});
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'));
});
本文介绍如何使用ExtJS框架中的JsonStore组件结合HttpProxy进行数据加载,并演示了如何监听数据加载完成事件来获取并展示数据。具体包括配置JsonStore与HttpProxy、定义字段以及加载完成后如何读取数据。
148

被折叠的 条评论
为什么被折叠?



