View Full Version : View getters in Controller : strange behavior

28 Feb 2012, 2:27 AM

In a controller, with 'views' setted, i've got a strange behavior while trying to work with the getters of views.

doSelect : function(model, record) {
var me = this,
infoView = me.getStockInfoView();

console.log('> doSelect : ' + Ext.getClassName(infoView));


The class name is ok, it's give me the right class name > doSelect : Foo.view.stock.Info)

But when i try to 'getComponent' I've got this error :

Uncaught TypeError: Object function () { return this.constructor.apply(this, arguments); } has no method 'getComponent'

I wonder what i'am doing wrong there ? :-?

N.b : does the 'getMyPanelView()' returns a Class or an Instance - this is maybe why... ?!

28 Feb 2012, 2:43 AM
...I'am right, those 'view' getters return a 'Class', not an instance.

So, i've still also have a problem concerning the 'views' in a controller :

I've define a 'ref' to point on my view.
I've try to get a 'component' using the 'getComponent' method (with the good id).

var me = this,
infoView = me.getStockInfo(); //defined in the refs


returns this error :

Uncaught TypeError: Cannot call method 'update' of undefined

But doing this :

var me = this,
infoView = me.getStockInfo();


all works fine !

ps : the 'container' (stock_info_name) is nested in one container and one panel in the stock view.