PDA

View Full Version : Need requires aside from views declaration for Views?



jiewmeng
22 May 2012, 12:32 AM
For models, stores and controllers, it appears its sufficient to simply have


Ext.application({
name: 'SimpleTodo',
requires: [
'Ext.container.Viewport'
],
models: [
'Project', 'TodoList', 'Todo'
],
stores: [
'Projects', 'TodoLists', 'Todos'
],
controllers: [
'SidebarController'
],


But for views, I need to add it to the requires array?


Ext.application({
name: 'SimpleTodo',
requires: [
'Ext.container.Viewport',
'SimpleTodo.view.Sidebar' // <--- here ...
],
views: [
'Sidebar' // <--- ... and here
],
models: [
'Project', 'TodoList', 'Todo'
],
stores: [
'Projects', 'TodoLists', 'Todos'
],
controllers: [
'SidebarController'
],


Why is there the difference?

mitchellsimoens
25 May 2012, 11:45 AM
The views should create a getter for each view if I remember correctly.

RodManMx
7 Jun 2012, 10:34 AM
As far as I remember, Views creates a reffernce to the class itself, and the require creates a reference to the object once it has been created