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);
}
});
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);
}
});