PDA

View Full Version : ExtJS MVC pattern + JAWR



Izaac
25 Nov 2011, 4:36 AM
Hello,

we are currently migrating from ExtJS3 to ExtJS 4. As the MVC pattern seems to be a good architecture to start from, we still have some open issues.

Does the usage of the MVC pattern also means that the folder structure as outlined in the Guides section is needed?
Is there another way to implement the MVC architecture without folders as we use JAWR to minify the javascript code part?

regards,
Izaac

mitchellsimoens
25 Nov 2011, 6:42 AM
This will help you with the file structure: http://docs.sencha.com/ext-js/4-0/#!/guide/application_architecture

The only reason why we have a "standard" for the folder structure is we have SDK Tools that will build your application files and Ext JS files (that aren't in the core, ext.js) into one single minified and obfuscated JS file. So would you really need JAWR?

Izaac
28 Nov 2011, 12:47 AM
Thanks for the reply. So the file structure is mandatory.

Are these SDK tools embedded in the extjs source code or is an additional download needed?

Regards,
Izaac

mitchellsimoens
28 Nov 2011, 6:21 AM
http://www.sencha.com/products/sdk-tools/

aw1zard2
28 Nov 2011, 3:09 PM
Where I work at currently also uses jawr and once we get everything moved to Ext JS 4 we will most likely not use it anymore.

You can provide your own folder structure I just found it easier to do the longhand instead of the shorthand in the requires.

So the requires code would look like something like this.


Ext.Loader.setConfig({
enabled: true,
paths: {
'MYAPP': '.'
}
});

Ext.application({
name: 'MYAPP.arch',
appFolder: 'arch-4.0.7',
requires: [
'MYAPP.arch.Ajax',
'MYAPP.arch.Grid',
'MYAPP.arch.Panel',
'MYAPP.arch.Form',
'MYAPP.arch.TabPanel'
]
});
Then we have each extended class as it's own file located at ./arch-4.0.7/

Ajax.js
Grid.js
Panel.js
Form.js
TabPanel.js