PDA

View Full Version : Controller getView



Urkman
25 Sep 2013, 7:15 AM
Hello,

I would like to do the following:

In my current controller I want to get another controller and the display it's view inside the current controllers view.

Is this possible?

Thanks,
Urkman

existdissolve
25 Sep 2013, 8:41 AM
You can create any view in any controller by full class path with Ext.create(), by xtype with Ext.widget(), or by config with the xtype.

Urkman
26 Sep 2013, 4:15 AM
Hello,

thanks for your answer.
But my problem is something else:

in one controller I use get "getController()" function to get a new controller.
That works fine. Then I call a function of this controller to fill some field inside the view of this controller.

And there I use "Ext.ComponentQuery.query('xxx');" to get the fields, but this list is empty every time :(

So it seems, that the view is not ready when I get the controller using the "getController()" function.

Greetings,
Urkman

ettavolt
29 Sep 2013, 9:54 PM
getView is used only to access view's class,. You may try to add ref (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.app.Controller-cfg-refs) to your controller with autoCreate:true and call respective getter before accessing any fields. Also, it maybe useful to add refs for those fields too instead of manually using ComponentQuery.