PDA

View Full Version : small problem in nested list



hemant1
15 Jun 2011, 11:47 PM
here is my code in that i got the store object but my list is not displaying
pls provide the assistence.

code and xml file:


Ext.regModel('slide', {
fields: [
//{name:'slide', mapping:'@id'},
{name:'slide'},
],
belongsTo:'Topic',
proxy:{
type:'ajax',
reader:{
type:'xml',
root:'Topic',
record:'slide'
}
}
});

Ext.regModel('Topic',{
fields:[
//{name:'Topic' , mapping:'@id'},
{name:'Topic'},
],
associations: [
{type: 'hasMany', model: 'slide', name: 'slide'}
]

//hasMany:{model:'slide',name:'slide'},

});


store = new Ext.data.TreeStore({
model: 'Topic',
//root: data,
proxy: {
type: 'ajax',
url :'FinalXmlindex.xml',
reader: {
type: 'tree',
root: 'Index'
}
},
autoLoad: true
});
my_List = new Ext.NestedList({
title: 'Menu',
//fullscreen: true,
//displayField: 'name',
store: store,
//method:'GET',
itemTpl: '<tpl for="."><span>{name} <tpl for="slide"><span>{name}</span></span></tpl></tpl>',
listeners:{
leafitemtap:leafitemtap
}
});




<?xml version="1.0" encoding="utf-8"?>
<Index name="A Beginners Guide to Options.pptx">
<Topic id="1" name="Topic1" order="1">
<slide id="1" name="Slide1" topicid="1" order="1"/>
<slide id="2" name="Slide2" topicid="1" order="2"/>
<slide id="3" name="Slide3" topicid="1" order="3"/>
<slide id="4" name="Slide4" topicid="1" order="4"/>
<slide id="5" name="Slide5" topicid="1" order="5"/>
</Topic>
</Index>