PDA

View Full Version : Nested list and carousel problem



hemant1
26 Jul 2011, 9:48 PM
Hi

I have created a menu like this

Topic1
Slide1(Child of Topic1)
Slide2(Child of Topic2)

Structure for the menu is


sink.Structure = [
{
text: 'Topic1',
items: [
{
text: 'Slide1',
id:'1',
card: demos.Carousel,
source: 'carousel.js',
leaf: true
},
{
text: 'Slide2',
id:'2',
card: demos.Carousel,
source: 'carousel.js',
leaf: true
},

{
text:'Interaction',
card:demos.Tab,
source:'tab.js',
leaf:true
}
]
},
{
text: 'Home',
card: demos.Carousel,
source: 'carousel.js',
leaf: true
},
{
text: 'Exit',
card: demos.Carousel,
leaf: true
}
];
Ext.regModel('Demo', {
fields: [
{ name: 'text', type: 'string' },
{ name: 'id', type: 'string' },
{ name: 'source', type: 'string' },
{ name: 'preventHide', type: 'boolean' },
{ name: 'cardSwitchAnimation' },
{ name: 'card' }
]
});
sink.StructureStore = new Ext.data.TreeStore({
model: 'Demo',
root: {
items: sink.Structure
},
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});



Now the problem is when i click on the Slide work it works properly and sow me the first page of carousel but when i click on the Slide2 again it shows me the first page of carousel
basically i want to do is when i click on slide1 it show me first page of carousel , when i click on slide2 it show me second page of carousel

How it is possible pls show me the way

thanks