pager now updates with updateComplete event

This commit is contained in:
Mottie 2012-10-25 17:57:59 -05:00
parent 5a62860b47
commit 6d8fe95da8
5 changed files with 12 additions and 13 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
/*!
* tablesorter pager plugin
* updated 10/17/2012
* updated 10/25/2012
*/
/*jshint browser:true, jquery:true */
;(function($) {
@ -209,7 +209,7 @@
$sh = $t.find('.' + ((tc.widgetOptions && tc.widgetOptions.stickyHeaders) || 'tablesorter-stickyheader'));
$f = $t.find('tfoot tr:first').children();
$t.find('th.' + tc.cssHeader).each(function(j){
var $t = $(this), tar, icn;
var $t = $(this), icn;
// add new test within the first span it finds, or just in the header
if ( $t.find('.' + tc.cssIcon).length ) {
icn = $t.find('.' + tc.cssIcon).clone(true);
@ -248,7 +248,7 @@
getAjax = function(table, c){
var $t = $(table),
url = (c.ajaxUrl) ? c.ajaxUrl.replace(/\{page\}/g, c.page).replace(/\{size\}/g, c.size) : '',
k, arry = [],
arry = [],
sl = table.config.sortList,
col = url.match(/\{sortList[\s+]?:[\s+]?(.*)\}/);
if (col) {
@ -434,14 +434,14 @@
}
// update pager after filter widget completes
if ( $(table).hasClass('hasFilters') ) {
$(table).unbind('filterEnd.pager').bind('filterEnd.pager', function() {
$(table)
.unbind('filterEnd.pager updateComplete.pager ')
.bind('filterEnd.pager updateComplete.pager', function() {
c.page = 0;
updatePageDisplay(table, c);
moveToPage(table, c);
changeHeight(table, c);
});
}
if ( $(c.cssGoto, pager).length ) {
$(c.cssGoto, pager).bind('change', function(){

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* TableSorter 2.4.5 - Client-side table sorting with ease!
* TableSorter 2.4.6 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
@ -493,10 +493,9 @@
}
function resortComplete($table, callback){
var t = $table[0];
$table.trigger('updateComplete');
if (typeof callback === "function") {
callback(t);
callback($table[0]);
}
}

File diff suppressed because one or more lines are too long