Sticky header sorting works again. Fixes #508

This commit is contained in:
Mottie 2014-02-21 17:15:29 -06:00
parent 8bd77b02f6
commit 5d0a109efb
2 changed files with 4 additions and 2 deletions

View File

@ -1076,6 +1076,8 @@
if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); }
// jQuery v1.2.6 doesn't have closest()
cell = /TH|TD/.test(this.tagName) ? this : $(this).parents('th, td')[0];
// reference original table headers and find the same cell
cell = c.$headers[ $headers.index( cell ) ];
if (!cell.sortDisabled) {
initSort(table, cell, e);
}

View File

@ -1229,8 +1229,8 @@ ts.addWidget({
// fix clone ID, if it exists - fixes #271
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
// clear out cloned table, except for sticky header
// include caption & filter row (fixes #126 & #249)
$stickyTable.find('thead:gt(0), tr.sticky-false, tbody, tfoot').remove();
// include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
$stickyTable.find('thead:gt(0), tr.sticky-false, tbody, tfoot').hide();
if (!wo.stickyHeaders_includeCaption) {
$stickyTable.find('caption').remove();
} else {