PDA

View Full Version : MVC Application file names (ExtJS 4)



basvanommen
4 Sep 2011, 11:01 AM
Hi there,

Just started to work with ExtJS 4 and MVC along with it. I've got a quite simple question. Taking this example (http://docs.sencha.com/ext-js/4-0/#!/guide/application_architecture) in mind, in the end I've got an IDE with tabs open:

Users.js (controller)
Users.js (view)
User.js (model)
user.json (data)

I'm using Coda, so could be an IDE flaw. Coda doens't show me where this file is located. So I've got to actually look at the code to determine which file I'm working in at that moment.

So I was wondering if there's any way of renaming these files like this (for example):

Users.controller.js
Users.view.js
User.model.js
user.json

is possible in any way. Now the Ext.Loader (I presume) wont be able to find the files.

PS: the provided code ends up with errors...

skirtle
4 Sep 2011, 4:01 PM
I think this is quite a common problem, not specific to Coda.

Rather than trying to munge the filenames you could just rename the classes. User is a good name for a model but the view and controller could easily be renamed. I find names like UsersGrid or UsersWindow much more helpful for views.

basvanommen
4 Sep 2011, 11:16 PM
Mmm, that's a nice thought. Thanks!