Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

extJs MVC for multiple pages

This might look like a dumb question but I am new to MVC particularly to extJs. I wish to work with the MVC approach. I followed this link http://www.extjsframework.com/mvc/simple-mvc-application. But it has only a single page as example. The example page uses app.js to load extjs views. Now here is my question. I have an application with multiple pages. Do i need to make separate app.js like scripts for each page of my app or could i use the same app.js accross all my pages. If i could, kindly mention how. Thanks...

like image 691
dev Avatar asked Jan 20 '26 23:01

dev


1 Answers

All of the answers here are correct, however the question seems to be a bit ambiguous so that's why they are all slightly different.

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

Your server side code/scripts are then typically reduced to JSON data services that provide data to the RIA app running completely independently in the client browser.

As you can see you would not need to have test.php and index.php and would suffice to have one index.php with ExtJS application running out of that page.

If this answer is not useful because you already knew all of this and really meant to ask about multiple controllers and modularization of an ExtJS application then that's a separate discussion and has been addressed to an extent in other posts. (look for lazy loading controllers).

Hope this helps.

like image 63
dbrin Avatar answered Jan 23 '26 13:01

dbrin