-
10 Jun 2012 1:37 AM #1
Unanswered: Listeners only work once
Unanswered: Listeners only work once
i am having a problem with my application , suppose there is a listener on a button in a certain panel , the listener works fine and the event gets fired in the first time. However , if i revisit this page the listeners wont work.i configure the listener in my controller as follows:Code:config: { refs:{ btn : '#mybtn' } control : { btn : { tap : 'doSmth' } } }, doSmth : function () { //some code goes here }
-
11 Jun 2012 1:14 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
This is because refs don't like the id config. If you move away from using the id config you will find more success.
Say you have this button config:
You will have the issue you are experiencing. But if you do something like this:Code:{ text : 'Save User', id : 'saveUser' }
and have your ref use this selector instead of #saveUser:Code:{ text : 'Save User', action : 'saveUser' }
Code:'button[action=saveUser]'
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.
-
6 May 2013 7:38 PM #3
mitchell you one awesome person!!!
it solved my problem also..
the only thing is that i think this info can be a lot more helpfull if put on the documentation (especially on the intro section and the tutorial video which tell us on how to connect component to event on controller)
**how do you know about this?


Reply With Quote