View Full Version : Generated View Getters
5 Apr 2012, 6:31 PM
//the rest of the Controller here});
In the code above, what is the automatic getter that is created? Is is getPostsListView()?
5 Apr 2012, 6:36 PM
Yes, that's right.
5 Apr 2012, 6:49 PM
It didnt work for me, not sure if something is going on because of lowercase posts.List
5 Apr 2012, 7:09 PM
var me = this;
console.log('Posts controller init', me);
Let try by adding the above red line of code, run and watch the console log. Do you see getPostsListView method?
7 Apr 2012, 8:32 AM
The generated getter is there but it is empty.
7 Apr 2012, 4:14 PM
View & Model getters just return respective classes, not instances as Store getters do.
8 Apr 2012, 2:44 AM
To get views instances use refs.
ref: 'postsListView', // the name you want for getter
selector: 'postslistview' //views alias/xtype
9 Apr 2012, 8:41 AM
I had the refs working fine, but whats the point of an auto generated getter for views if they don't return instances?
9 Apr 2012, 9:57 AM
First that comes in my mind is that you could have more views of the same type in a controller, so that's why better to manage them with selectors. Regarding views class getter, this could be useful in controller.
Powered by vBulletin® Version 4.1.5 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.