-
13 Apr 2012 7:49 AM #1
Answered: Life cycle of a component.
Answered: Life cycle of a component.
hi every body, how its going?

still new in the big world of extjs, i am trying to run an animation of sliding. i create a container and put on it tow components, one of them is to be animated. the problem is that i dont know where to call the methode slideIn()to run the animation. i tested it in the console of firebug and it works fine. so i thought it may be has something to do with the life cycle of componentCode:Ext.getCmp('newsMsg').getEl().slideIn('r',{duration:3000,easing:'linear'}).slideOut('l',{duration:3000,easing:'linear'});
so i tried to do this Code:onRender:function(){ this.callParent(arguments); console.log('smhsopg'); Ext.getCmp('newsMsg').getEl().slideIn('r',{duration:3000,easing:'linear'}).slideOut('l',{duration:3000,easing:'linear'}); }
in the container but still dont get anything, all i got is this message .Code:Uncaught TypeError: Cannot call method 'slideIn' of undefined
can anybody give me a clue or/and explain me the life cycle of a component in Extjs 4.
thank you

-
Best Answer Posted by mitchellsimoens
You need to do it int he render or afterrender event so that the element is created.
-
13 Apr 2012 8:25 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
You need to do it int he render or afterrender event so that the element is created.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
13 Apr 2012 8:50 AM #3


Reply With Quote