PDA

View Full Version : Page getting blank



satya.p
2 Jan 2011, 1:23 AM
Hi To all,

I need help, please help me!

What i want to do, i want to read the data from url or xml file using json. I implement below code but it getting blank
page. Can any one let me know what wrong in below code.

Thank in advance!


Ext.regModel('User', {
fields: ['name', 'email']
});

topicsStore = new Ext.data.Store({
model: 'User',
proxy: {
type: 'ajax',
url : 'data.xml',
reader: {
type: 'xml',
model: 'User',
record: 'user'

}
}

});


topics = new Ext.Panel({
iconCls: 'favorites',
title:'topics',
cls: 'demo-list',
items: [{

xtype: 'list',
disclosure: {
scope: topicsStore,
handler: function(record, btn, index) {
alert('Disclose more info for ' + record.get('newsTitle'));
}
},
store: topicsStore,
tpl: '<tpl for="."><div class="class="contact""><table><tr><td width="70" style="font-size:20px; text-align:center; font-weight:bold">{name}</td><td><strong>{name}</strong><br>{email}</td></tr></table></div></tpl>',
itemSelector: 'div.contact'
//singleSelect: true
}]
})


And here is my xml file,

<?xml version="1.0" encoding="UTF-8"?>
<user>
<id>1</id>
<name>Ed Spencer</name>
<email>[email protected]</email>
</user>
<user>
<id>2</id>
<name>Abe Elias</name>
<email>[email protected]</email>
</user>