Core: get column index from data-attribute when sorting

This commit is contained in:
Mottie 2014-10-10 07:54:17 -05:00
parent ad85121da0
commit 5cd7b33df7

View File

@ -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