Results 1 to 3 of 3

Thread: Get subset of store

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    18
    Vote Rating
    0
      0  

    Default Unanswered: Get subset of store

    Hi everyone,

    How can i use the same json store in many combos of a form, for example

    Code:
    {"success":true,
    "data":[
      {"id":1,"description":"object1", "group":"group1"},
      {"id":2,"description":"object2", "group":"group1"},
      {"id":4,"description":"object3", "group":"group2"},
      {"id":5,"description":"object4", "group":"group2"},
      {"id":6,"description":"object5", "group":"group3"},
      {"id":7,"description":"object6", "group":"group3"}
    ]}
    So in my form i want to have 3 combos, each of them with different registers, depending on the group field, but based on the same store

    Thanks in advance for any help

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,748
    Answers
    130
    Vote Rating
    128
      0  

    Default

    3 combos with one store share the filters, so it is not a good idea if they are editable.
    Code:
    triggerAction: 'all'
    does help a bit.

    i recommend to use 3 stores, load one via ajax and fill the other two locally with content on the load event of the first store. you can use Ext.define() to create a store class and instanciate it 3 times.
    Best regards
    Tobias Uhlig

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    18
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by tobiu View Post
    3 combos with one store share the filters, so it is not a good idea if they are editable.
    Code:
    triggerAction: 'all'
    does help a bit.

    i recommend to use 3 stores, load one via ajax and fill the other two locally with content on the load event of the first store. you can use Ext.define() to create a store class and instanciate it 3 times.
    Hi Tobias, thanks for answer

    I'm actually calling independent stores, but the problem is that i'm doing 20 queries to the server, and the time to load the form is too much, so i was thinking to call just one store and filter it by group in the client, and show a subset for each combobox.

    If you have other approach i really appreciate it

Posting Permissions

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