-
11 Dec 2011 8:04 AM #1
Controller Not Recognizing xtype ComponentQuery
Controller Not Recognizing xtype ComponentQuery
Possible bug.
After hours of running various tests, it looks like ST2 PR2 might have a bug in the way Ext.app.Controller is using Ext.ComponentQuery to provision a control...or--the other alternative is--I just can't figure out how to invoke control correctly.
According the docs, Ext.ComponentQuery can be invoked with an xtype.
Below is an example which illustrates the problem.
The function called by the painted control is not being invoked:
Welcome your suggestions; thanks!Code:Ext.define('MyApp.controller.Viewport', {extend: 'Ext.app.Controller', views: ['Hello'], init: function(){this.control({'hello': { //xtype provisioned in Hello.jspainted: this.onContainerPainted}});}, onContainerPainted: function(){console.log('The container was painted'); //DOES NOT DISPLAY IN CONSOLE}}); console.log('Exiting MyApp.controller.Viewport'); //DOES DISPLAY IN CONSOLE
Plane Wryter
-
12 Dec 2011 12:13 AM #2
Few tips to debug:
- Have you tried listening to the painted event on the component itself?
- Try hiding and then showing the component. Does the controller get the event then?
It looks like the painted event *may* be getting fired too early?Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote