-
23 Feb 2012 9:26 AM #1
[4.1.0B3] Component render, afterrender, beforerender handlers in controller.Control
[4.1.0B3] Component render, afterrender, beforerender handlers in controller.Control
I found that in [B3] component render, afterrender, and beforerender (I didn't test others, yet) events will fire fine if I set up a listeners config in my class definition or in an instance of the component, but my app's controller's control method would no longer see the events.
I discovered that if I put something in the listeners config on the class definition that the controller would see the event.
*abstract from controller.control()
By itself the above code works in B2, but not in B3.Code:, 'mygrid': { beforerender: function () { console.log('grid afterrender event fired from the controller') } , afterrender: function () { console.log('grid afterrender event fired from the controller') } , render: function () { console.log('grid render event fired from the controller') } }
If in mygrid's definition I do the following the above code will fire from the controller (*with afterrender commented out below it won't fire the afterrender event in the controller, but the other two fire - uncomment and all three fire).
Code:, listeners: { beforerender: Ext.emptyFn , render: Ext.emptyFn , afterrender: Ext.emptyFn }
-
23 Feb 2012 9:52 AM #2
-
23 Feb 2012 9:55 AM #3
I see. Thx.
-
23 Feb 2012 8:56 PM #4
These are different issues. The link above is specifically about the return value of fireEvent. This is a bug in how the MVC EventBus does not get along with the hasListeners optimization.
Thanks for the report! I'm going to move this to the bugs forum and link a ticket.Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
29 Feb 2012 6:56 AM #5
I see that this bug has just been marked as fixed.
We noticed that in beta-3 the destroy event is not captured by the controller either. The workaround of defining a Ext.emptyFn listener on the component does not seem to help with this particular event.
Does this fix address the destroy event as well as beforerender/render/afterrender?
Thanks.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-5442
in
TBD.


Reply With Quote