这里是我的Xml法典:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<investors>
<investor name="Active"/>
<investor name="Aggressive"/>
<investor name="Conservative"/>
<investor name="Day Trader"/>
<investor name="Very Active"/>
</investors>
<events>
<event period="3 Month Expiry"/>
<event period="LEAPS"/>
<event period="Monthlies"/>
<event period="Monthly Expiries"/>
<event period="Weeklies"/>
</events>
<prices>
<price rate="$0.5"/>
<price rate="$0.05"/>
<price rate="$1"/>
<price rate="$22"/>
<price rate="$100.34"/>
</prices>
</root>
我的守则是:
Ext.onReady(function(){
var hi= [],hello = [], hey = [];
Ext.getBody().mask(true, <div class="demos-loading">Loading…</div> );
var tsstore = new Ext.data.Store({
url: xmlformat.xml ,
autoLoad: true,
reader: new Ext.data.XmlReader({
record: investor
}, [{name: name , mapping: @name }])
});
var evstore = new Ext.data.Store({
url: xmlformat.xml ,
autoLoad: true,
reader: new Ext.data.XmlReader({
record: event
}, [{name: Eve , mapping: @period }])
});
var prstore = new Ext.data.Store({
url: xmlformat.xml ,
autoLoad: true,
reader: new Ext.data.XmlReader({
record: price
}, [{name: Pri , mapping: @rate }])
});
var tsgrid = new Ext.grid.GridPanel({
store: tsstore,
columns: [{header: "Trading Style", dataIndex: name , sortable: true}],
renderTo: example-grid ,
width:540,
height:200
});
var evgrid = new Ext.grid.GridPanel({
store: evstore,
columns: [{header: "Events", dataIndex: Eve , sortable: true}],
renderTo: example-gridone ,
width:540,
height:200
});
var prgrid = new Ext.grid.GridPanel({
store: prstore,
columns: [{header: "Price", dataIndex: Pri , sortable: true}],
renderTo: example-gridtwo ,
width:540,
height:200
});
hello.push(tsstore.getRange());
});
储存在“书店”中的数据,希望将其复制成一个阵列。
i 想要产出:
hello = {"$0.5","$0.05","$1","$22","$100.34"}
but it s not working for me please help thank you