Something wrong with my XML?
- by Prateek Raj
hi everyone,
i'm parsing an xml with my extjs but it returns only one of the five components.
only the first one of the five components.
Ext.regModel('Card', {
fields: ['investor']
});
var store = new Ext.data.Store({
model: 'Card',
proxy: {
type: 'ajax',
url: 'xmlformat.xml',
reader: {
type: 'xml',
record: 'investors'
}
},
listeners: {
single: true,
datachanged: function(){
Ext.getBody().unmask();
var items = [];
store.each(function(rec){
alert(rec.get('investor'));
});
and my xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<investors>
<investor>Active</investor>
<investor>Aggressive</investor>
<investor>Conservative</investor>
<investor>Day Trader</investor>
<investor>Very Active</investor>
</investors>
<events>
<event>3 Month Expiry</event>
<event>LEAPS</event>
<event>Monthlies</event>
<event>Monthly Expiries</event>
<event>Weeklies</event>
</events>
<prices>
<price>$0.5</price>
<price>$0.05</price>
<price>$1</price>
<price>$22</price>
<price>$100.34</price>
</prices>
</root>
wen i run the code only "Active" comes out. . . .
i know that i'm doing something wrong but i'm not sure what....
please help . . . . .