1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    Arlington, VA
    Posts
    14
    Vote Rating
    0
    varunet is on a distinguished road

      0  

    Default Unanswered: How to clear proxy?

    Unanswered: How to clear proxy?


    I am loading a list from the store which is getting data from a search engine in JSON format.

    To the list, I have implemented the "ListPaging" plugin and the pagination is working fine.
    It appropriately increments the "start" attribute to get the right data.

    I am having a problem, if I am trying to reuse and reload the list with another set of data. As I want to reset the "start" property to 0. The store data gets cleared appropriately, but I am not able to clear the proxy data.
    How do I approach this? has the clear api depricated for the proxy?

    this following code is there in my controller.
    var store = Ext.StoreManager.get('Projects');
    store.data.clear(); // this works fine
    store.getProxy().clear(); // Gives me the error "Uncaught TypeError: Object [object Object] has no method 'clear'"
    store.getProxy().setExtraParam('start', '0'); // this sets it at 0, but then the ListPaging stops working and the 'start' value does not increment any more.

    store.load();

    Thank you for your help.

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Posts
    78
    Vote Rating
    1
    Answers
    4
    kskrumpet is on a distinguished road

      0  

    Default


    I'm a but unclear what you're trying to acheive here - I can't imaging a sitation where I wouldn't use the loadPage method on the store.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    Arlington, VA
    Posts
    14
    Vote Rating
    0
    varunet is on a distinguished road

      0  

    Default


    Sorry, If I was unclear..

    The list component is in the view and not in the store. I am using the store to just load data into the list component. All this is done through a controller.

    everything is working fine.. just trying to figure out on how to reset 'start' / 'startParam' to 0. When new set of data is loaded.

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Vote Rating
    0
    Answers
    1
    transwebsolutions is on a distinguished road

      0  

    Default


    i am probably shooting in the dark with this answer. have you tried creating a blank json file and load the empty json file.

  5. #5
    Sencha User siebmanb's Avatar
    Join Date
    Aug 2011
    Location
    Geneva (CH) - Grenoble (FR)
    Posts
    253
    Vote Rating
    16
    Answers
    11
    siebmanb will become famous soon enough

      0  

    Default


    I believe the loadPage method is the right one. Just use loadPage(1,...) for example instead of the normal load().

    Documentation : http://docs.sencha.com/touch/2-0/#!/...ethod-loadPage
    Twitter account @siebmanb.
    Co-founder & CEO at ButterflyEffect.
    Mobile application developer using Sencha Touch and Phonegap for iOS, Android and webapp.