1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    43
    Vote Rating
    0
    tthai is on a distinguished road

      0  

    Default Unanswered: how to clear store extraParams

    Unanswered: how to clear store extraParams


    In my code, I'm doing this for my store before calling videoStore.load();

    videoStore.getProxy().setExtraParam('type', 'blog');
    videoStore.getProxy().setExtraParam('type_id', 123);

    Else where in my app, I reuse the same videoStore proxy ,however I would like to clear out those previous params (without explicityly doing setExtraParam('type', '')

    Is there a method for this in ST2?

  2. #2
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    37
    Vote Rating
    0
    Answers
    1
    jakobgrannas is on a distinguished road

      0  

    Default


    I'm not sure, because I haven't done this before, but couldn't you just either send an empty object with setExtraParams() (note the "s" at the end) to reset them? If you want to reset them first and then add a fresh set of params I think you could just send an object with only one property, like so:

    Code:
    videoStore.getProxy.setExtraParams({}) <-- Reset extraParams
    videoStore.getProxy().setExtraParams({ <--- Reset and add a fresh set of params type: 'article', type_id: 456 });
    I don't know if you just want to reset the extraParams or if you want to reset them before adding new ones, but if it's the latter you can do it as shown in the code above. That should "reset" and add new params, if I'm not mistaken.

    EDIT: Do this to reset it: myStore.getProxy().setExtraParams(null). I'm using this myself, so I know it works.

Thread Participants: 1