mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Core: get column index from data-attribute when sorting
This commit is contained in:
parent
ad85121da0
commit
5cd7b33df7
@ -459,6 +459,7 @@
|
||||
$(this).html('<div class="' + ts.css.headerIn + '">' + t + '</div>'); // faster than wrapInner
|
||||
}
|
||||
if (c.onRenderHeader) { c.onRenderHeader.apply($t, [index, c, c.$table]); }
|
||||
// *** remove this.column value if no conflicts found
|
||||
this.column = parseInt( $(this).attr('data-column'), 10);
|
||||
this.order = formatSortingOrder( ts.getData($t, ch, 'sortInitialOrder') || c.sortInitialOrder ) ? [1,0,2] : [0,1,2];
|
||||
this.count = -1; // set to -1 because clicking on the header automatically adds one
|
||||
@ -649,7 +650,7 @@
|
||||
});
|
||||
}
|
||||
// get current column index
|
||||
indx = cell.column;
|
||||
indx = parseInt( $(cell).attr('data-column'), 10 );
|
||||
// user only wants to sort on one column
|
||||
if (key) {
|
||||
// flush the sort list
|
||||
|
Loading…
Reference in New Issue
Block a user