mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
updated pager plugin - fixes #151
This commit is contained in:
parent
9087cdaf22
commit
597ec7d768
@ -17,7 +17,8 @@ td.tablesorter-pager {
|
|||||||
/* pager output text */
|
/* pager output text */
|
||||||
.tablesorter-pager .pagedisplay {
|
.tablesorter-pager .pagedisplay {
|
||||||
padding: 0 5px 0 5px;
|
padding: 0 5px 0 5px;
|
||||||
width: 50px;
|
width: auto;
|
||||||
|
white-space: nowrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
hideRows = function(table, c){
|
hideRows = function(table, c){
|
||||||
|
if (!c.ajaxUrl) {
|
||||||
var i,
|
var i,
|
||||||
rows = $('tr:not(.' + table.config.cssChildRow + ')', table.tBodies),
|
rows = $('tr:not(.' + table.config.cssChildRow + ')', table.tBodies),
|
||||||
l = rows.length,
|
l = rows.length,
|
||||||
@ -160,6 +161,7 @@
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
hideRowsSetup = function(table, c){
|
hideRowsSetup = function(table, c){
|
||||||
@ -180,9 +182,10 @@
|
|||||||
// ajaxProcessing result: [ total, rows, headers ]
|
// ajaxProcessing result: [ total, rows, headers ]
|
||||||
var i, j, hsh, $f, $sh,
|
var i, j, hsh, $f, $sh,
|
||||||
$t = $(table),
|
$t = $(table),
|
||||||
$b = $(table.tBodies).filter(':not(.' + table.config.cssInfoBlock + ')'),
|
tc = table.config,
|
||||||
|
$b = $(table.tBodies).filter(':not(.' + tc.cssInfoBlock + ')'),
|
||||||
hl = $t.find('thead th').length, tds = '',
|
hl = $t.find('thead th').length, tds = '',
|
||||||
err = '<tr class="remove-me"><td style="text-align: center;" colspan="' + hl + '">' +
|
err = '<tr class="' + tc.selectorRemove + '"><td style="text-align: center;" colspan="' + hl + '">' +
|
||||||
(exception ? exception.message + ' (' + exception.name + ')' : 'No rows found') + '</td></tr>',
|
(exception ? exception.message + ' (' + exception.name + ')' : 'No rows found') + '</td></tr>',
|
||||||
result = c.ajaxProcessing(data) || [ 0, [] ],
|
result = c.ajaxProcessing(data) || [ 0, [] ],
|
||||||
d = result[1] || [],
|
d = result[1] || [],
|
||||||
@ -201,13 +204,22 @@
|
|||||||
// only add new header text if the length matches
|
// only add new header text if the length matches
|
||||||
if ( th && th.length === hl ) {
|
if ( th && th.length === hl ) {
|
||||||
hsh = $t.hasClass('hasStickyHeaders');
|
hsh = $t.hasClass('hasStickyHeaders');
|
||||||
$sh = $t.find('.' + ((c.widgetOptions && c.widgetOptions.stickyHeaders) || 'tablesorter-stickyheader'));
|
$sh = $t.find('.' + ((tc.widgetOptions && tc.widgetOptions.stickyHeaders) || 'tablesorter-stickyheader'));
|
||||||
$f = $t.find('tfoot tr:first').children();
|
$f = $t.find('tfoot tr:first').children();
|
||||||
$t.find('thead tr.tablesorter-header th').each(function(j){
|
$t.find('th.' + tc.cssHeader).each(function(j){
|
||||||
var $t = $(this),
|
var $t = $(this), tar, icn;
|
||||||
// add new test within the first span it finds, or just in the header
|
// add new test within the first span it finds, or just in the header
|
||||||
tar = ( $t.find('span').length ) ? $t.find('span:first') : $t;
|
if ( $t.find('.' + tc.cssIcon).length ) {
|
||||||
tar.html( th[j] );
|
icn = $t.find('.' + tc.cssIcon).clone(true);
|
||||||
|
$t.find('.tablesorter-header-inner').html( th[j] ).append(icn);
|
||||||
|
if ( hsh && $sh.length ) {
|
||||||
|
icn = $sh.find('th').eq(j).find('.' + tc.cssIcon).clone(true);
|
||||||
|
$sh.find('th').eq(j).find('.tablesorter-header-inner').html( th[j] ).append(icn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$t.find('.tablesorter-header-inner').html( th[j] );
|
||||||
|
$sh.find('th').eq(j).find('.tablesorter-header-inner').html( th[j] );
|
||||||
|
}
|
||||||
$f.eq(j).html( th[j] );
|
$f.eq(j).html( th[j] );
|
||||||
// update sticky headers
|
// update sticky headers
|
||||||
if ( hsh && $sh.length ){
|
if ( hsh && $sh.length ){
|
||||||
|
Loading…
Reference in New Issue
Block a user