json的:
Ext.onReady(function (){
var _store=new Ext.data.JsonStore({
//data:[{sex:"男"},{sex:"女"}],//存放到数组里
//fields:['sex']//解析
proxy:new Ext.data.HttpProxy({url:"http://localhost/IISHelp/ExtJSTest/server/app/test/11/xmlstore.asp"})
alert(_store.getCount());
//解析
alert(Ext.util.JSON.encode(_store.getAt(0).get("sex")));
});
_store.load();
})
xml的:
Ext.onReady(function (){
var _store=new Ext.data.JsonStore({
//data:[{sex:"男"},{sex:"女"}],//存放到数组里
//fields:['sex']//解析
proxy:new Ext.data.HttpProxy({url:"http://localhost/IISHelp/ExtJSTest/server/app/test/11/xmlstore.asp"})
reader:new Ext.data.XmlReader({record:"row"},Ext.data.Record.create(["name","sex",name:"age",type:"int"]))
});
_store.on("load",function(_store){
alert(_store.getCount());
//解析
alert(Ext.util.JSON.encode(_store.getAt(0).get("sex")));
})
_store.load();
})
Ext.onReady(function (){
var _store=new Ext.data.JsonStore({
//data:[{sex:"男"},{sex:"女"}],//存放到数组里
//fields:['sex']//解析
proxy:new Ext.data.HttpProxy({url:"http://localhost/IISHelp/ExtJSTest/server/app/test/11/xmlstore.asp"})
alert(_store.getCount());
//解析
alert(Ext.util.JSON.encode(_store.getAt(0).get("sex")));
});
_store.load();
})
xml的:
Ext.onReady(function (){
var _store=new Ext.data.JsonStore({
//data:[{sex:"男"},{sex:"女"}],//存放到数组里
//fields:['sex']//解析
proxy:new Ext.data.HttpProxy({url:"http://localhost/IISHelp/ExtJSTest/server/app/test/11/xmlstore.asp"})
reader:new Ext.data.XmlReader({record:"row"},Ext.data.Record.create(["name","sex",name:"age",type:"int"]))
});
_store.on("load",function(_store){
alert(_store.getCount());
//解析
alert(Ext.util.JSON.encode(_store.getAt(0).get("sex")));
})
_store.load();
})