PDA

View Full Version : How to get the istance of a View from Controller?



pierluigi
2 Jul 2012, 12:52 AM
Ext.define('DigitalPaper.controller.Documents', {
extend: 'Ext.app.Controller',

views: ['Documents'],
stores: ['Documents'],
models: ['Documents'],

init: function() {
console.log('[OK] Init Controller: Documents');
}
});
What's the function to get the View (Istance) of this controller? I've tried


Ext.getView('Documents');
this.getView('Documents');
this.getView();
this.getViewModel();
Any suggests?

jsakalos
2 Jul 2012, 1:54 AM
The asiest is to use refs (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.app.Controller-cfg-refs).