PDA

View Full Version : setActiveItem animation doesnt work



RobbeR
1 Apr 2012, 4:54 AM
Hello,


In Sencha Touch 2, I use this code snippet in my controller:



this.control({
'#test_button': {
tap: function () {
var root_c = Ext.getCmp("main_container");
root_c.setActiveItem(
1, {type:'slide', direction: 'left'}
);
}
}
});


It works nicely, but it switches only the "default way", not the "sliding way". Can anyone help, why?Thanks in advance,
R

Edited: Sorry about the bad code formatting

mitchellsimoens
1 Apr 2012, 9:07 AM
Check out animateActiveItem instead of setActiveItem. setActiveItem in ST2 doesn't support animation.

RobbeR
1 Apr 2012, 9:20 AM
It works like a charm :)
Thank you for your help!

R

AkashSaikia
11 Apr 2012, 8:26 AM
I had the same problem, but solved now because of the animateActiveItem :) Thanks.