Results 1 to 2 of 2

Thread: Store Looping

  1. #1

    Default Answered: Store Looping

    Hi
    Iam trying to create newstore from available store like shown below

    function subStore(fieldLabel)
    {

    var newStore=new Ext.create('Ext.data.Store',{
    fields:['key','value'],
    id:'SplitOrderFilterStore_'+fieldLabel
    });

    quoteStatusCountryStore.data.each(function(item, index, totalItems) {
    quoteStatusCountryStore.filter(function(storeField) {
    var field = storeField.get('key');
    if (field == fieldLabel){
    newStore.add(quoteStatusCountryStore.data.items[index]);
    }
    });

    });

    return newStore;
    }
    The problem is that after the loop of quoteStatusCountryStore.data.each(function(item, index, totalItems) {.....} the quoteStatusCountryStore becomes empty...Pls kindly help...


  2. I can't for the life of me work out what you're trying to do here but I do know if you want to filter a store using a function you need to use filterBy() not filter()

  3. #2

    Default

    I can't for the life of me work out what you're trying to do here but I do know if you want to filter a store using a function you need to use filterBy() not filter()

Posting Permissions

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