PDA

View Full Version : Problem in reading xml file



yasodha
28 Dec 2010, 1:11 AM
Hi, I'm new to sencha touch. I want to read an xml file and put its content in a list. here i have used a callback method for store load. it s not working. Can any one help on this. Thanks in advance.

code:<code>
Ext.regModel('Search', {

fields: [{

name: 'titl',

type: 'string'

}, {

name: 'dat',

type: 'date'

}, {

name: 'notes',

type: 'string'

}]

});


var store = new Ext.data.Store({

model:'Search',

proxy:new Ext.data.HttpProxy({url: 'src/test1.xml'}),
reader: {

type:'xml',

record: 'test'
}


});

store.on('load', function(){

alert(store.getTotalCount());
});

var list = new Ext.List({

fullscreen: true,


itemTpl : '{titl},{dat},{notes}',

store: store,

renderTo:'example-grid'
});
</code>