PDA

View Full Version : Basic XML Example



danvega
26 Jul 2010, 3:54 PM
I am trying to put together a basic xml example. When I run the following example I get the error "Uncaught TypeError: Cannot read property 'totalProperty' of undefined". The docs say its not needed if your loading all in at once but just to be sure I tried adding that to the xml and I still get the same error.



<?xml version="1.0" encoding="utf-8"?>
<developers>
<total>10</total>
<developer>
<id>1</id>
<firstName>Joe</firstName>
<lastName>Smith</lastName>
</developer>
<developer>
<id>1</id>
<firstName>John</firstName>
<lastName>Smith</lastName>
</developer>
</developers>




Ext.regModel("Developer",{
fields: [
{name:'id',type:'int'},
{name:'firstName',type:'string'},
{name:'lastName',type:'store'}
]
});

list = new Ext.List({
fullscreen:true,
tpl:'<tpl for="."><div class="developer">{track}</div></tpl>',
itemSelector:'div.developer',
singleSelect:true,
dockedItems:[
new Ext.Toolbar({
dock:'bottom',
title:'Developers'
})
],
store: new Ext.data.Store({
autoLoad:true,
model:'Developer',
proxy: {
url:'developers.xml',
type:'ajax',
reader:'xml'
}
})
});

evant
26 Jul 2010, 4:42 PM
There's currently issues with the Xml Reader, we're working to get them ironed out.

danvega
26 Jul 2010, 4:43 PM
Perfect..thanks for the help..