Pager: Restore check for new headers. Fixes #1343

This commit is contained in:
Rob Garrison 2016-12-29 04:11:20 -06:00
parent 6032b121f3
commit 7528607eb4
4 changed files with 35 additions and 32 deletions

View File

@ -472,8 +472,8 @@
}
}
p.processAjaxOnInit = true;
// only add new header text if the length matches
if ( th && th.length === hl ) {
// update new header text
if ( th ) {
hsh = $table.hasClass('hasStickyHeaders');
$sh = hsh ?
c.widgetOptions.$sticky.children('thead:first').children('tr:not(.' + c.cssIgnoreRow + ')').children() :

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -774,36 +774,39 @@
}
}
wo.pager_processAjaxOnInit = true;
hsh = $table.hasClass( 'hasStickyHeaders' );
$sh = hsh ?
wo.$sticky.children( 'thead:first' ).children( 'tr:not(.' + c.cssIgnoreRow + ')' ).children() :
'';
$f = $table.find( 'tfoot tr:first' ).children();
// don't change td headers (may contain pager)
$headers = c.$headers.filter( 'th' );
len = $headers.length;
for ( j = 0; j < len; j++ ) {
$h = $headers.eq( j );
// add new test within the first span it finds, or just in the header
if ( $h.find( '.' + ts.css.icon ).length ) {
icon = $h.find( '.' + ts.css.icon ).clone( true );
$h.find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
if ( hsh && $sh.length ) {
icon = $sh.eq( j ).find( '.' + ts.css.icon ).clone( true );
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
}
} else {
$h.find( '.' + ts.css.headerIn ).html( th[ j ] );
if ( hsh && $sh.length ) {
// add sticky header to container just in case it contains pager controls
p.$container = p.$container.add( wo.$sticky );
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] );
// update new header text
if ( th ) {
hsh = $table.hasClass( 'hasStickyHeaders' );
$sh = hsh ?
wo.$sticky.children( 'thead:first' ).children( 'tr:not(.' + c.cssIgnoreRow + ')' ).children() :
'';
$f = $table.find( 'tfoot tr:first' ).children();
// don't change td headers (may contain pager)
$headers = c.$headers.filter( 'th' );
len = $headers.length;
for ( j = 0; j < len; j++ ) {
$h = $headers.eq( j );
// add new test within the first span it finds, or just in the header
if ( $h.find( '.' + ts.css.icon ).length ) {
icon = $h.find( '.' + ts.css.icon ).clone( true );
$h.find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
if ( hsh && $sh.length ) {
icon = $sh.eq( j ).find( '.' + ts.css.icon ).clone( true );
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
}
} else {
$h.find( '.' + ts.css.headerIn ).html( th[ j ] );
if ( hsh && $sh.length ) {
// add sticky header to container just in case it contains pager controls
p.$container = p.$container.add( wo.$sticky );
$sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] );
}
}
$f.eq( j ).html( th[ j ] );
}
if ( hsh ) {
tsp.bindEvents( c );
}
$f.eq( j ).html( th[ j ] );
}
if (hsh) {
tsp.bindEvents( c );
}
}
if ( c.showProcessing ) {