1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
    dbabaioff is on a distinguished road

      0  

    Default Unanswered: Sencha touch mvc flow

    Unanswered: Sencha touch mvc flow


    Hi,
    I'm new to sencha touch, and I'm trying to understand the flow in a MVC application.
    Let's say an application that have a list and when I click in one of the items open another panel.
    And I have a controller with routes, some views, a store + json proxy and a model.
    When the application starts I'm creating a new view (the list), and at this point I need to load my store to populate my view. Then, my question is: Who loads the store? a controller or inside my view I load my store.
    In general:
    How should be the flow? my controller (when match a route) makes all the actions, like the controller talk to the the store (load the store) and create a view? or my controller creates a view and my view talk to the store to receive the data?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3461
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    How are you attaching the store to the list? Like what is the store config on the list look like?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
    dbabaioff is on a distinguished road

      0  

    Default


    My view is a Panel and inside I have a list, and I'm attaching the store using the store config field (using the storeId). and on my controller I'm doing:

    PHP Code:
    Ext.getStore("MY STORE").getProxy().setUrl('...');
    Ext.getStore("MY STORE").load();


    Ext.Viewport.setActiveItem("MY VIEW"); 
    and then my list is rendering the store data.
    Should I move this code (first 2 lines) from controller to the view ?

Thread Participants: 1

Tags for this Thread