Results 1 to 6 of 6

Thread: Clearing store with PagingToolbar

  1. #1
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default Clearing store with PagingToolbar

    Hi,

    if i clear the store with
    store.removeAll()

    the grid is empty and the records are removed - but the PagingToolbar doesn't refresh and shows all records (count and pages), even if i click on the refresh button, all records are visible again.

    How can i reset the PagingToolbar as well?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751

    Default

    Hi Steffen,

    the PagingToolbar itself has no reset-method.
    I guess you are using no local store, so you should reload the store sending the param start:0 and return totalCount:0 in your JSON / xml.

    As a workaround, you could also try to call the priate method:

    Code:
    store.removeAll();
    store.setBaseParams({start:0});
    myPagingToolbar.onLoad(store, 0, {});

    Kind regards,
    tobiu
    Best regards
    Tobias Uhlig

  3. #3
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    Hi Tobi,

    sure, i could make a request with empty result. But i don't like it, as i only want to clear the data. So i don't get why the binded control doesn't update correct.
    For now i disable the pageingToolbar, but then it shows the loading indicator. Hiding component adds strange white bar (i think an CSS issue).

    I also try to unbind, but this cause error (this.store is undefined). I will dig into the code later, do you confirm this as Bug?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751

    Default

    Hi Steffen,

    did my workaround work?
    I took the time to search the forums and Condor has already written a patch that perfectly fits your needs (listening to add, remove, remove all).

    https://www.extjs.com/forum/showthre...032#post395032


    Kind regards,
    Tobias
    Best regards
    Tobias Uhlig

  5. #5
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    Hi Tobi,

    your hack doesn't work for me, PagingToolbar doesn't change anything, also refresh shows all records again.

    I will test Condor's override, i only need the clear-part, i don't add any rows programmatically.

    Thanks for your help!
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  6. #6
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    Hi,

    The override from Condor just works perfect!

    The reason why i do this:

    I have a store with remote bound, a grid showing the data. I use this as "search in data", so i only load data if a search is done. Like with all search i have a "clear" button which empties the view and clear the search field, so i need the controls updated.

    I don't agree with evant that this is no bug - in my eyes every store-bound object should change when store data change, if i do that manually i don't need any bound. But this is another story
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Posting Permissions

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