PDA

View Full Version : Having issues with adding additional views and controllers when following the MVC pat



macdoug1
21 Oct 2012, 7:57 PM
To start I am following the ExtJs pattern of MVC that is shown in the examples. It works fine for that has about 9 views in it but once I add more then 9 views to the controller it will stop working. Also if I create another controller and add my views to it then add my controller to the main app.js class it will stop working as well. Can someone explain to me why this is or if I'm doing something wrong? I didn't include any code but it is basically very much the same as what you see in your examples - except that I'm adding more views and controllers.

example:
Controller
views:[ 'grid-view',
'grouped-grid-view',
'level4-grid-data',
'level4-grid',
'bundle-details',
'bundle-details-grid',
'createbundle-window',
'additems-tobundle',
'file-upload'//,
// 'bundle-issues-grid'
],

in app.js
controllers: [ 'grid-controller',
'new-controller'
],

evant
21 Oct 2012, 8:13 PM
There's no reason adding more should cause any issues. What happens if you look in the Chrome dev tools, are there any errors?

macdoug1
21 Oct 2012, 11:38 PM
I removed a couple views from the controller and it seems to work. But if I add another controller to the app.js it fails and nothing shows up in the console.

I'm also having another issue with loading the Ext.ux.RowExpander.js It can't find the file because it is putting slashes in like Ext/ux/RowExpander.js and can't find it. Any idea how to fix this?

Ext.Loader.setPath('Ext.ux', './js/Ext/ux');
Ext.define('AM.view.bundle-issues-grid' ,{
requires:['Ext.ux.RowExpander'],
extend: 'Ext.grid.Panel',
alias : 'widget.bundleissues',

This gives me the right path but the slashes are keeping the file from being found.