PDA

View Full Version : Simple MVC demo available?



ralphmyers420
3 Dec 2013, 3:33 PM
Hi,

I'm just now trying to make the jump to Ext4 and could really use an example project to demonstrate how to get my page to work properly. I've read a lot of the docs and forum posts already and they've helped a lot. Unfortunately, I'm still getting stuck when trying to replicate how my existing (ext 3.x) functions in an MVC framework.
The main issue that I have is that I haven't found an example of a tree node loading an HTML or JS page in a tab within a tabPanel. In other words, each node in the tree is ties to an HTML or JS file (located on the server). I'd like to click on the node a see the page render in a new tab within the TabPanel.
I've got a lot of it worked out already. The JSON tree loads fine, all the views and stores are working properly, and I can get a blank tab to open on selecting a node, but I'm not sure how to get the actual load to happen.

Any help that anyone can provide would be wonderful.
Thanks

scottmartin
3 Dec 2013, 3:50 PM
That is a tall order ;)

Here is a quick online example of an MVC approach
http://ext4all.com/post/extjs-4-mvc-application-architecture

ChristianSA
3 Dec 2013, 11:42 PM
Great sample1 How come the "add.js" and "edit.js" are identical except for the title field? It seems like code redundancy. Wouldn't it make more sense to have one form definition and then just change the title depending on the desired action? Anything preventing that?

scottmartin
4 Dec 2013, 5:11 AM
The purpose of MVC is to organize you code. It is best practice to make each class (view, controller, etc) in a separate file. I agree that add/edit would simply use the same. This may be just a case of a quick demo.