PDA

View Full Version : Reading an xml file and displaying in a list



yasodha
22 Dec 2010, 12:41 AM
Hi all, i'm new to sencha touch. I need some one to help to read an xml file and print it in a list. i ve uploaded the code. i dont know whats's wrong in this 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



:{

type



:'ajax',

url



:'test1.xml',

success:function(){





alert



("success");

},


reader:{





type:'xml',





record:'test'





}


}


});






store.load();








var list =new Ext.List({


fullscreen:true,






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





grouped:false,





indexBar:false,






store: store





});



list.show();



If i run the html file the page is loading . there is no response. I need help on this. Thanks in advance.

maulik
24 Jan 2011, 5:14 AM
hi yasodha..

for that problem..

take panel and show the list in that panel..

i have the same problem and i used panel to show that list... and it works fine..

spaceman123
24 Jan 2011, 5:16 AM
Thanks I used nestedlists instead - I found that was the best way of doing it. But I had to convert an asp file to json first.

yasodha
24 Jan 2011, 8:49 PM
Thanks for the reply maulik. I used nestedlist and json instead of list and xml.