Results 1 to 3 of 3

Thread: Sencha touch mvc flow

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    How are you attaching the store to the list? Like what is the store config on the list look like?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
      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 ?

Tags for this Thread

Posting Permissions

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