ExtJs MVC for multiple pages

This may seem like a stupid question, but I'm new to MVC, especially extJ. I want to work with an MVC approach. I followed this link http://www.extjsframework.com/mvc/simple-mvc-application . But it only has one page as an example. The example page uses app.js to load extjs views. Now here's my question. I have an application with multiple pages. Do I need to create separate app.js like scripts for each page of my application, or can I use the same app.js on all of my pages. If I could, kindly mention how to do this. Thank...

+3


source to share


4 answers


All the answers here are correct, however the question seems to be a bit ambiguous, so they are all a little different.

A typical RIA application is a single HTML (or php, jsp, asp) page with many different views that the JS framework manages, so changing pages is no longer required (and avoided in most cases for performance reasons).

The server side code / scripts are then usually boiled down to JSON data services that provide data to an RIA application that runs entirely in the client browser.



As you can see, you don't need to have test.php and index.php, and it would be enough to have one index.php with ExtJS app on this page.

If this answer isn't helpful because you already knew all this and really wanted to ask about multiple controllers and modulation of an ExtJS app, then this is a separate discussion and has been covered in other posts. (look for lazy load controllers).

Hope it helps.

+2


source


Every page. Every time the page is unloaded, like the JS slider, it is cleared. The browser actually caches the files, but the code is executed the same as the first time.



0


source


This is usually the same app.js for all the different views.

0


source


MVC concept from MVC about architecture. The documentation explains this pretty easily.

Every Ext JS 4 application starts with an instance of the Application class. The app contains global settings for your app (such as the app name) and also maintains references to all models, views, and controllers used by the app. The app also contains a launch function that launches automatically when everything is loaded.

As you can see in the docs, you will have one app.js app, which looks like a load, responsible for instantiating the entire app.

You are going to structure your files, however, following an MVC approach or pattern in order to have a nice and clean architecture.

0


source







All Articles