Filter row is now included in stickyHeader + pager. Fixes #449

This commit is contained in:
Mottie 2013-12-15 07:11:26 -06:00
parent d1cfbd7bae
commit b34bbba563
3 changed files with 6 additions and 3 deletions

View File

@ -298,7 +298,7 @@
// 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 = hsh ? c.$sticky.children('thead:first').children().children() : ''; $sh = hsh ? c.widgetOptions.$sticky.children('thead:first').children().children() : '';
$f = $t.find('tfoot tr:first').children(); $f = $t.find('tfoot tr:first').children();
// don't change td headers (may contain pager) // don't change td headers (may contain pager)
c.$headers.filter('th').each(function(j){ c.$headers.filter('th').each(function(j){

View File

@ -1066,7 +1066,10 @@ ts.addWidget({
stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs
}, },
format: function(table, c, wo) { format: function(table, c, wo) {
if (c.$table.hasClass('hasStickyHeaders')) { return; } // filter widget doesn't initialize on an empty table. Fixes #449
if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
return;
}
var $cell, var $cell,
$table = c.$table, $table = c.$table,
$attach = $(wo.stickyHeaders_attachTo), $attach = $(wo.stickyHeaders_attachTo),

View File

@ -484,7 +484,7 @@ tsp = ts.pager = {
// 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 = hsh ? c.$sticky.children('thead:first').children().children() : ''; $sh = hsh ? wo.$sticky.children('thead:first').children().children() : '';
$f = $t.find('tfoot tr:first').children(); $f = $t.find('tfoot tr:first').children();
// don't change td headers (may contain pager) // don't change td headers (may contain pager)
c.$headers.filter('th').each(function(j){ c.$headers.filter('th').each(function(j){