Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-4205 in a recent build.
  1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    107
    Vote Rating
    0
    foxmarco is on a distinguished road

      0  

    Exclamation PagingToolBar problem

    PagingToolBar problem


    I've tried a GridPanel with paging toolbar, in case of zero (0) records there is a problem on paging toolbar that show paging 1 of 0 and it also possible move to next page so 2 of 0 , 3 of 0 etc etc

    Any solution?

    Thanks

  2. #2
    Sencha User
    Join Date
    Sep 2008
    Posts
    107
    Vote Rating
    0
    foxmarco is on a distinguished road

      0  

    Default


    Any news?

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    mufi is on a distinguished road

      0  

    Default


    I just ran into this myself (or, rather, my QA team did). Any hints?

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2007
    Posts
    19
    Vote Rating
    0
    mufi is on a distinguished road

      0  

    Default


    This might not be the optimal solution, but I was able to get around this by overriding the onLoad method in PagingToolbar; these two lines in particular:

    Code:
    /*These two lines are changes, so as to default the pageCount to 1 if pageCount is NaN or 0, thereby disabling the #next and #last buttons.*/
    
    pageCount = isNaN(pageData.pageCount) || pageData.pageCount == 0 ? 1 : pageData.pageCount;     
    afterText = Ext.String.format(me.afterPageText, pageCount);

  5. #5
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    Boston
    Posts
    81
    Vote Rating
    4
    germanicus is on a distinguished road

      0  

    Default


    I can reproduce half of this. In my latest build, when the data is an empty array, my pager says "1 of 0" but I can't page to page 2 or 3, etc. like you say.

    Please provide your source so I can reproduce in full. I can submit a bug with what I have now, but I'll wait for your code. Please make it concise so I can just drop it into a page and run it.

  6. #6
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    1
    Vote Rating
    0
    GeorgeR1 is on a distinguished road

      0  

    Default


    Any news on this? The Page 1 of 0 is something that we need resolving.
    I haven't seen the Page 2 of 0

    Thanks

  7. #7
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      1  

    Default


    (for those on 4.0.7)I've made the following override for the issue. Basically if the total count is 0 records, it sets the page count to 1, whereas the old code did not consider this situation,

    Code:
    Ext.override(Ext.toolbar.Paging, {
    getPageData : function(){        var store = this.store,
                totalCount = store.getTotalCount();
    
    
            return {
                total : totalCount,
                currentPage : store.currentPage,
                pageCount: (totalCount === 0) ? 1 : Math.ceil(totalCount / store.pageSize),
                fromRecord: ((store.currentPage - 1) * store.pageSize) + 1,
                toRecord: Math.min(store.currentPage * store.pageSize, totalCount)
    
    
            };
        }
    });

  8. #8
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default


    Thank you, Reimius.
    My problem, which was as same as foxmarco, was fixed.

    But I found another problem today.

    I'm using a grid dynamically loads the data.
    After seeing Page 2 of 2, the grid loads different json which contains small number of data. Suppose that it must show 1 of 1.
    But it shows 2 of 1.

    Can anyone solve this problem?

  9. #9
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default


    When reloading the grid with a different set of data, do not use grid.load, instead use your paging toolbar and the function moveFirst().

  10. #10
    Sencha User woodville's Avatar
    Join Date
    Aug 2011
    Location
    Japan
    Posts
    27
    Vote Rating
    0
    woodville is on a distinguished road

      0  

    Default


    Thank you again, Reimius.

    It worked perfectly.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi