mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Dev fix: The columning classes should be applied to the columns the user
has selected for sorting, not the data sorted columns (although they are usually the same) - https://datatables.net/forums/discussion/18714
This commit is contained in:
parent
7477cee42d
commit
af287d50a2
@ -1 +1 @@
|
|||||||
059275a51400f3ffac61170fcc4dd0a78be33c1d
|
72a8f1106b4dd9fca8cb7afb2087c4bb0bf65b87
|
||||||
|
12
media/js/jquery.dataTables.js
vendored
12
media/js/jquery.dataTables.js
vendored
@ -4096,7 +4096,7 @@
|
|||||||
aSort = [],
|
aSort = [],
|
||||||
aiOrig = [],
|
aiOrig = [],
|
||||||
aoColumns = settings.aoColumns,
|
aoColumns = settings.aoColumns,
|
||||||
aDataSort, iCol, sType,
|
aDataSort, iCol, sType, srcCol,
|
||||||
fixed = settings.aaSortingFixed,
|
fixed = settings.aaSortingFixed,
|
||||||
fixedObj = $.isPlainObject( fixed ),
|
fixedObj = $.isPlainObject( fixed ),
|
||||||
nestedSort = [],
|
nestedSort = [],
|
||||||
@ -4129,7 +4129,8 @@
|
|||||||
|
|
||||||
for ( i=0 ; i<nestedSort.length ; i++ )
|
for ( i=0 ; i<nestedSort.length ; i++ )
|
||||||
{
|
{
|
||||||
aDataSort = aoColumns[ nestedSort[i][0] ].aDataSort;
|
srcCol = nestedSort[i][0];
|
||||||
|
aDataSort = aoColumns[ srcCol ].aDataSort;
|
||||||
|
|
||||||
for ( k=0, kLen=aDataSort.length ; k<kLen ; k++ )
|
for ( k=0, kLen=aDataSort.length ; k<kLen ; k++ )
|
||||||
{
|
{
|
||||||
@ -4137,6 +4138,7 @@
|
|||||||
sType = aoColumns[ iCol ].sType || 'string';
|
sType = aoColumns[ iCol ].sType || 'string';
|
||||||
|
|
||||||
aSort.push( {
|
aSort.push( {
|
||||||
|
src: srcCol,
|
||||||
col: iCol,
|
col: iCol,
|
||||||
dir: nestedSort[i][1],
|
dir: nestedSort[i][1],
|
||||||
index: nestedSort[i][2],
|
index: nestedSort[i][2],
|
||||||
@ -4434,7 +4436,7 @@
|
|||||||
if ( features.bSort && features.bSortClasses ) {
|
if ( features.bSort && features.bSortClasses ) {
|
||||||
// Remove old sorting classes
|
// Remove old sorting classes
|
||||||
for ( i=0, ien=oldSort.length ; i<ien ; i++ ) {
|
for ( i=0, ien=oldSort.length ; i<ien ; i++ ) {
|
||||||
colIdx = oldSort[i].col;
|
colIdx = oldSort[i].src;
|
||||||
|
|
||||||
// Remove column sorting
|
// Remove column sorting
|
||||||
$( _pluck( settings.aoData, 'anCells', colIdx ) )
|
$( _pluck( settings.aoData, 'anCells', colIdx ) )
|
||||||
@ -4443,7 +4445,7 @@
|
|||||||
|
|
||||||
// Add new column sorting
|
// Add new column sorting
|
||||||
for ( i=0, ien=sort.length ; i<ien ; i++ ) {
|
for ( i=0, ien=sort.length ; i<ien ; i++ ) {
|
||||||
colIdx = sort[i].col;
|
colIdx = sort[i].src;
|
||||||
|
|
||||||
$( _pluck( settings.aoData, 'anCells', colIdx ) )
|
$( _pluck( settings.aoData, 'anCells', colIdx ) )
|
||||||
.addClass( sortClass + (i<2 ? i+1 : 3) );
|
.addClass( sortClass + (i<2 ? i+1 : 3) );
|
||||||
@ -6139,7 +6141,7 @@
|
|||||||
var sortedColumns = {};
|
var sortedColumns = {};
|
||||||
|
|
||||||
$.each( aSort, function (i, val) {
|
$.each( aSort, function (i, val) {
|
||||||
sortedColumns[ val.col ] = val.dir;
|
sortedColumns[ val.src ] = val.dir;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
_fnCallbackFire( oSettings, null, 'order', [oSettings, aSort, sortedColumns] );
|
_fnCallbackFire( oSettings, null, 'order', [oSettings, aSort, sortedColumns] );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user