PDA

View Full Version : One Controller multiple Views



Urkman
19 Aug 2013, 7:09 AM
Hello,

is it possible to have multiple views with one controller?
e.g:
The user fills out one form and when everything is valid, I need to show him an other view with a grid.

What is the best way to handle this?

Thanks,
Urkman

tobiu
19 Aug 2013, 10:14 AM
yes, you can control multiple views with one controller, even views of the same xtype.

just use the selectors you want to inside the this.control() method of the controller.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.ComponentQuery

in case you want to control multiple views of the same xtype i recommend to not use refs, since they are static.