PDA

View Full Version : setDirection() in Sencha Designer 2



mescalito2
25 Apr 2012, 11:21 AM
Hi! thanks for your time!
Looking at the example you provided in the kitchensink you have this:


text: 'Slide Right',
card: false,
id: 'SlideRight',
view: 'SlideRight',
animation: {
type: 'slide',
direction: 'right'
},


Based on that example I don't know how to assign the animation = {} property using Sencha designer 2 (I think there is no way). Then I tried to do it programmatic and it didn't worked. I just want to animate from right to left when I change the active card. any idea? thanks!

This is my code

buttonBackImageDetalle: function(button, e, options) {


var main = this.getMain();
Ext.fx.Animation.setDirection('right');
main.setActiveItem(1);
console.log('<-- back');


}

mitchellsimoens
27 Apr 2012, 5:03 AM
Instead of affecting the direction, I usually change the reverse config using setReversed(false)

mescalito2
27 Apr 2012, 5:23 AM
How? code please!

mitchellsimoens
27 Apr 2012, 5:28 AM
The animation config is on the layout. Get that and then do the setReversed

DevlisH
27 Apr 2012, 5:01 PM
Try this code:



main.getLayout().setAnimation({
type : 'slide',
direction : 'right' // or left
});


and the you call setActiveMethod() to trigger the animation.

Cheers!