Something wrong with my XML?

Posted by Prateek Raj on Stack Overflow See other posts from Stack Overflow or by Prateek Raj
Published on 2011-01-10T09:29:47Z Indexed on 2011/01/12 1:53 UTC
Read the original article Hit count: 566

Filed under:
|

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 . . . . .

© Stack Overflow or respective owner

Related posts about extjs

Related posts about xmlparsing