1. #1
    Ext User ushkinaz's Avatar
    Join Date
    Apr 2008
    Posts
    25
    Vote Rating
    0
    ushkinaz is on a distinguished road

      0  

    Default [CLOSED] PagingToolBar, change page size

    [CLOSED] PagingToolBar, change page size


    Code:
    toolbar.setPageSize(10);
    toolbar.setActivePage(0);
    
    toolbar.setPageSize(20);
    toolbar.setActivePage(0);
    Last call does nothing while it should reload the page.

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    setActivePage expects the page number, not the index. I have changed the docs to:

    "Sets the active page (1 to page count inclusive)."

  3. #3
    Ext User ushkinaz's Avatar
    Join Date
    Apr 2008
    Posts
    25
    Vote Rating
    0
    ushkinaz is on a distinguished road

      0  

    Default


    Does it make difference regarding this bug report? =) I think not.

  4. #4
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Did you look at the code?

    Code:
        if (page != activePage && page > 0 && page <= pages) {
          loader.load(--page * pageSize, pageSize);
        } else {
          pageText.setText(String.valueOf((int) activePage));
        }
    page has to be > than 0. Am I missing something?

  5. #5
    Ext User ushkinaz's Avatar
    Join Date
    Apr 2008
    Posts
    25
    Vote Rating
    0
    ushkinaz is on a distinguished road

      0  

    Default


    Yes, you are. Change 0 to anything else and the bug is still there.
    The problem is not in (page > 0) check it is (page != activePage).
    If I change page size, setting active page to anything, including same page index as it was before, should reload that page. In my humble opinion =)

    An example
    I have 100 items: "1", "2", "3" ... so on.
    Page size is 2. setActivePage(2) shows items (3,4).
    Then I setPageSize(3) and setActivePage(2) again. It should show (4,5,6), but it shows (3,4)

Thread Participants: 1