mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Sticky header sorting works again. Fixes #508
This commit is contained in:
parent
8bd77b02f6
commit
5d0a109efb
@ -1076,6 +1076,8 @@
|
|||||||
if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); }
|
if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); }
|
||||||
// jQuery v1.2.6 doesn't have closest()
|
// jQuery v1.2.6 doesn't have closest()
|
||||||
cell = /TH|TD/.test(this.tagName) ? this : $(this).parents('th, td')[0];
|
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) {
|
if (!cell.sortDisabled) {
|
||||||
initSort(table, cell, e);
|
initSort(table, cell, e);
|
||||||
}
|
}
|
||||||
|
@ -1229,8 +1229,8 @@ ts.addWidget({
|
|||||||
// fix clone ID, if it exists - fixes #271
|
// fix clone ID, if it exists - fixes #271
|
||||||
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
|
if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
|
||||||
// clear out cloned table, except for sticky header
|
// clear out cloned table, except for sticky header
|
||||||
// include caption & filter row (fixes #126 & #249)
|
// 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').remove();
|
$stickyTable.find('thead:gt(0), tr.sticky-false, tbody, tfoot').hide();
|
||||||
if (!wo.stickyHeaders_includeCaption) {
|
if (!wo.stickyHeaders_includeCaption) {
|
||||||
$stickyTable.find('caption').remove();
|
$stickyTable.find('caption').remove();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user