Results 1 to 4 of 4

Thread: Simple MVC demo available?

  1. #1

    Default Simple MVC demo available?

    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

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    That is a tall order

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

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2013
    Location
    denmark
    Posts
    42

    Default

    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?

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •