Results 1 to 3 of 3

Thread: Filling 2 Stores with one request

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Answers
    6

    Default Filling 2 Stores with one request

    So the subject is:
    I have 2 stores
    How can I fill them with one AJAX request.
    I now that there is a root property of proxy object that can be set to divide data of those stores but, when I try to do that there are always 2 requests

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    You can have one store load in one root just normal. Then you have to get the other root to load that into the other store. To get something off the raw data you should use createAccessor on the reader. This is how it gets the total and success properties.

    Code:
    this.getOtherRoot = this.createAccessor('otherRoot');
    Now you have a getOtherRoot method on the reader that will fetch the the root 'otherRoot'. Now you just have to execute this passing in the raw data.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Answers
    6

    Default

    Could you please point me to some tutorial or documentation link about the subject

Posting Permissions

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