Results 1 to 2 of 2

Thread: Loading of Nested Store with Filter attribute

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default Loading of Nested Store with Filter attribute

    I am trying to load a nested model store.

    Store A has nested Store B

    Store A is loaded and a filter is applied on it.

    Now I want to Load store B with the filtered records

    I am trying to hack this with following logic. The logic works But this solution seems to be unscalable

    Please suggest if there is alternative approach to load the nested stored with filter.

    Is there a simple API which can avoid iteration over each record

    //On Load of A Store callback
    onAStoreLoad : function(records, operation, successful) {
    //Load nested B Store
    var myBstore = this.getGetBStore();
    //get the filer of AStore
    var myfilterfeature = operation.filters[0].value;
    // Now iterate over all the Recores of Store A
    Ext.each(records, function(rec, index) {
    //Check if the filter is matching if yes load the recored
    if (rec.get('filterdid') == myfilterfeature) {
    myBstore.loadData(rec.get('nestedreores'))
    }
    });

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Answers
    13
    Vote Rating
    10
      0  

    Default

    i dont think theres an api that wont iterate over the records but im not 100% sure.
    if you worry bout scalability then think that Store A wont go to 1000+ records because net speed and client memory and other stuff, is you expect reaching those numbers then the operation should be made in the server side and from the client just send the operation to be made.
    if Store A wont go that big then iterating over it shouldnt be a problem.
    Also maybe you can change the solution to your problem, if you describe what you are trying to do with Store B maybe theres another way to do that, instead of copy records from A.

    (bad english :d)

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
  •