-
8 Jun 2011 1:15 AM #1
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
-
8 Jun 2011 12:45 PM #2
-
26 Jul 2011 9:50 AM #3
I just ran into this myself (or, rather, my QA team did). Any hints?
-
26 Jul 2011 10:31 AM #4
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);
-
26 Jul 2011 5:12 PM #5
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.
-
4 Oct 2011 7:39 AM #6
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
-
8 Feb 2012 7:49 AM #7
(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) }; } });
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-4205
in
TBD.


Reply With Quote