[CLOSED] [1.0] #{Store1}.removeAll() does not reset grid paging

  1. #1

    [CLOSED] [1.0] #{Store1}.removeAll() does not reset grid paging

    I have a button with a listener event that I expect to clear a store and reset the pagingtoolbar on the grid:

    <ext:Button ID="btnOK" runat="server" Text="Ok" Icon="MagnifierZoomIn">
                <Listeners>
                    <Click Handler="#{Store1}.removeAll();" />
                </Listeners>
            </ext:Button>
    The Store does clear but the pagingtoolbar is not reset. I found this in ExtJS community forum:

    http://www.extjs.com/forum/showthrea...gtoolbar+reset

    I believe it's the same issue. It doesn't look like it's been implemented because if I try:

    <ext:Button ID="btnOK" runat="server" Text="Ok" Icon="MagnifierZoomIn">
    
                <Listeners>
    
                    <Click Handler="#{Store1}.removeAll();#{PagingToolBar1}.reset();" />
    
                </Listeners>
    
            </ext:Button>
    it throws an error.

    Is there any chance the solution could get implemented until the time that ExtJS rolls it out - or is there some other step that I am missing?

    Thanks
  2. #2

    RE: [CLOSED] [1.0] #{Store1}.removeAll() does not reset grid paging

  3. #3

    RE: [CLOSED] [1.0] #{Store1}.removeAll() does not reset grid paging

    If I add that code

    #{Store1}.load(#{Store1}.lastOptions);
    after the

    #{Store1}.removeAll();
    it's reloading the store and that is not what I wanted. I want the Grid to be empty - which it is with the removeAll() and I want the PagingToolBar to show like the attached.

    In the other post you said that the paging toolbar only updated with a store rebind. I think it should also get updated when the store is 'unbound' via removeAll(). That was what the ExtJS forum post was showing that I included.

    I feel like I am still misunderstanding something.
  4. #4

    RE: [CLOSED] [1.0] #{Store1}.removeAll() does not reset grid paging

    Hi,

    Do you have any proxy in the store? As mentioned in that topic: you have to remove proxy or call reload and bind empty empty data on server side
  5. #5

    RE: [CLOSED] [1.0] #{Store1}.removeAll() does not reset grid paging

    I feel like binding an empty dataset is a lot to go through to reset when .removeAll() corrects the store.

    I just added a function to reset and call that instead. It does what I need without having to rebind the empty dataset serverside:

    <Listeners>
                    <Click Handler="#{Store1}.removeAll(); resetToolbar(#{PagingToolBar1}); " />
                </Listeners>
    <script type="text/javascript">
    function resetToolbar(tbar) {
                    tbar.updateInfo();
                    tbar.inputItem.setValue(1);
                    tbar.afterTextItem.setText(String.format(tbar.afterPageText, 1));
                    tbar.next.setDisabled(true);
                    tbar.prev.setDisabled(true);
                    tbar.first.setDisabled(true);
                    tbar.last.setDisabled(true);
    
    } 
    </script>
    Thanks~



Similar Threads

  1. Replies: 11
    Last Post: Jun 13, 2012, 4:53 PM
  2. Replies: 1
    Last Post: Oct 06, 2011, 8:12 AM
  3. [CLOSED] removeAll EditableGrid
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 07, 2011, 10:07 AM
  4. [CLOSED] Reset store's sort info on grid reload/reconfigure
    By jchau in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 10, 2010, 4:06 PM
  5. Reset Grid Pager
    By kumarxlnt in forum 1.x Help
    Replies: 2
    Last Post: Jan 08, 2010, 5:01 AM

Posting Permissions