PDA

View Full Version : Small fix for PagingToolbar



gordon
26 Feb 2007, 3:37 AM
Jack,

I have a small fix for the PagingToolbar. There was a problem using the "go to end" button when there were no rows "left over" on the final page. It would just go to the second page under these circumstances.

You will find the patch in SVN format below.

Regards,

Gordon



Index: ext/ext-all-debug.js
===================================================================
--- ext/ext-all-debug.js (revision 11210)
+++ ext/ext-all-debug.js (working copy)
@@ -12937,7 +12937,8 @@
case "last":
var total = ds.getTotalCount();
var extra = total % this.pageSize;
- var lastStart = total - (extra || total-this.pageSize);
+// var lastStart = total - (extra || total-this.pageSize); // bug where extra==0
+ var lastStart = extra ? (total - extra) : total-this.pageSize;
ds.load({params:{start: lastStart, limit: this.pageSize}});
break;
case "refresh":

jack.slocum
26 Feb 2007, 5:11 AM
Thanks Gordon. This is in Rev 5.