Core: Allow passing headers from multiple rows. See #1116

This commit is contained in:
Rob Garrison 2018-04-11 19:36:41 -05:00
parent 2983454fda
commit 200fcacb3b

View File

@ -518,11 +518,8 @@
ts.buildCache( c );
}
$cell = ts.getClosest( $( this ), '.' + ts.css.header );
// reference original table headers and find the same cell
// don't use $headers or IE8 throws an error - see #987
temp = $headers.index( $cell );
c.last.clickedIndex = ( temp < 0 ) ? $cell.attr( 'data-column' ) : temp;
// use column index if $headers is undefined
// use column index from data-attribute or index of current row; fixes #1116
c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
cell = c.$headers[ c.last.clickedIndex ];
if ( cell && !cell.sortDisabled ) {
ts.initSort( c, cell, e );