1

I am trying to parse an xml file. I am getting the error: Cannot call method 'on' of undefined. Can anybody tell me what the problem is? How do I fix it?

<?xml version="1.0" encoding="windows-1250"?>
<users>
    <user>
        <id>1</id>
        <name>Ed Spencer</name>
        <email>ed@sencha.com</email>
    </user>
    <user>
        <id>2</id>
        <name>Abe Elias</name>
        <email>abe@sencha.com</email>
    </user>
</users>

This is my store

Ext.define('TestXml.store.Test', {
    extend : 'Ext.data.Store',
    storeId : 'testStore',
    model : 'TestXml.model.Test',
    autoLoad : 'true',
    proxy : {
        type : 'ajax',
        url : 'test.xml',
        reader : {
            type : 'xml',
            record: 'user',
            rootProperty :'users'
        }
    }


});

This is my model

Ext.define('TestXml.model.Test', {
    extend : 'Ext.data.Model',
    fields : [{
        name : 'id',
        type : 'string'
    }, {
        name : 'name',
        type : 'string'
    }



]

});

This is my app.js

items: [{

         xtype : 'combo',
          store : 'testStore', //loading the store
           minWidth : 50,
            minHeight :30,
            displayField :'id',
             valueField :'name'

          }]

Thanks

4

0 回答 0