PDA

View Full Version : [B1] getters for views removed?



estesbubba
2 Feb 2012, 8:14 AM
So we had our views defined in controllers and did getXXXView().create(). I see that views were removed from controllers so I put them in the application. Appears getApplication().getXXXView() doesn't exist either.

So is the preferred way now to do Ext.create() for all views?

mitchellsimoens
2 Feb 2012, 11:44 AM
Yes. Ed did some major MVC rewriting for PR4 and has said that they weren't used that much versus the performance hit it took when starting up the app.

Rhoover
2 Feb 2012, 12:28 PM
Which, if I'm understanding right, explains why:




showBlogList: function() {
var viewBL = this.getBlogListView();
console.log('wtf');
viewBL.setActiveItem(1);

}

doesn't work with the 'Cannot call method 'setActiveItem' of undefined' error.

Yet why does:




showBlogList: function() {
var viewBL = Ext.Create('alchemistBeer.view.BlogList');
console.log('wtf');
viewBL.setActiveItem(1);
}


throw the "Object #<Object> has no method 'Create'" error?

mitchellsimoens
2 Feb 2012, 12:29 PM
It should be Ext.create not Ext.Create

Rhoover
2 Feb 2012, 1:09 PM
<p class="embarassed" style="bright glowing Red"> oh.....nevermind </p>

off and running, thx Mitchell!!

mitchellsimoens
2 Feb 2012, 1:14 PM
<p class="embarassed" style="bright glowing Red"> oh.....nevermind </p>

off and running, thx Mitchell!!

No worries. I do those little mistakes all the time too :)