1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    30
    Answers
    3
    Vote Rating
    0
    Isnogud is on a distinguished road

      0  

    Default Answered: Store.load(param) not working?

    Answered: Store.load(param) not working?


    Hi,
    I have a problem with my store and the load() function.
    I tried this:
    Store:
    Code:
        config : {
            model : 'MyApp.model.MyAppModel',
            proxy : {
                type : 'ajax',
                url :'../app/statistics.json',
                extraParams: {
                    type: 'NECESSARY_TYPE'
                },
                reader : {
                    type : 'json',
                    rootProperty : 'statistics'
                }
            }
        }
    Code:
            var myStore= Ext.data.StoreManager.get('MyStore');
            var storeParams = {
                entity: record.get('entityId')
            };
            if (record.get('anotherId')) {
                storeParams.anotherId= record.get('anotherId');
            }
            myStore.load(storeParams);
    But it did not work. The entityId was always 1, so it didn't change and I don't know why.
    Then I tried this:
    Code:
    myStore.getProxy().setExtraParams({entity: record.get('entityId')});
    But it overrides(deletes) the param 'type' in the store/proxy configuration which was also horrible.

    Then I did this:
    Code:
       var myStore= Ext.data.StoreManager.get('MyStore');
            myStore.getProxy().setExtraParams({
                entity: record.get('entityId'),
                anotherId: record.get('anotherId'),
                type : 'NECESSARY_TYPE'
            });
            myStore.load();
    And it's working. But I don't want to have too much information in my controller.
    What am I doing wrong here?

  2. Nevermind, forgot to tell the function that these are params.


    Code:
    var storeParams = {
    entityId: record.get('entityId'),
    anotherId: record.get('anotherId')
    };     
     myStore.load({params : storeParams});

  3. #2
    Sencha User
    Join Date
    Dec 2012
    Posts
    30
    Answers
    3
    Vote Rating
    0
    Isnogud is on a distinguished road

      0  

    Default


    Nevermind, forgot to tell the function that these are params.


    Code:
    var storeParams = {
    entityId: record.get('entityId'),
    anotherId: record.get('anotherId')
    };     
     myStore.load({params : storeParams});

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi