Results 1 to 4 of 4

Thread: Multiple Stores Using the Same Model

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Atlanta, Georgia
    Posts
    40

    Default Multiple Stores Using the Same Model

    I have multiple stores using the same model. This is because one of them contains search results, and another contains a regular record set.

    You can click on a search result and it populates a form just like the regular items do. However, because the store isn't the same, a save() is only possible if I lookup the correct store.

    I'd rather not use two stores for this use case. Does it seem strange that I'm doing this?

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

    Default

    So you have a record that you got from one store and did a setRecord on a form and when you go to save the model it doesn't know which store it came from?
    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
    Jan 2012
    Location
    Atlanta, Georgia
    Posts
    40

    Default

    Sort of. I'm passing the record from a view, finding its storeId and looking up the store based on that. Than I'm saving the correct store.

    Problem is, I don't feel like I should be using two different stores that use the same model.

  4. #4
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,153
    Answers
    33

    Default

    As of Ext 4.1 this should be valid and work (in theory) since Model instances (aka Records) can be bound to multiple stores.

Posting Permissions

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