PDA

View Full Version : Why activate event run tow times every time.



andrewlam
8 Apr 2012, 3:26 AM
My code below.My problem is when the viewport start the "TopCarousel" activate event will run two times every time.If the "TopCarousel" loaded tow times? Somebody can help me fix the bug.Thanks a lot!



Ext.define('TopCarousel', {
extend: 'Ext.Carousel',
config: {
layout:'card',
indicator: true,
height:160,
ui:'dark',
scrollable: {
direction: false,
directionLock: false
},
items:[
{html:'Carousel1'},
{html:'Carousel2'}
],
listeners:{
activate:function(){console.log(1);}
}

}
});


Ext.application({
launch: function() {

var Content=Ext.create('Ext.Panel',{"
fullscreen:true,
items:[
new TopCarousel,
{
xtype:'panel',
html:'DownContent'
}

]

});

Ext.Viewport.add(Content);
}


});

mitchellsimoens
24 Apr 2012, 7:59 AM
The active item is changed many times for the Content panel.