1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-27 00:54:15 +01:00

Fix: dt-init sorting as 1D array didn't get indexing correct

* The sort handler was expecting to deal with a 2D array, so we always
  dropped into the single column first sort condition.
* See thread 20811 for more information.
This commit is contained in:
Allan Jardine 2014-05-15 10:06:06 +01:00
parent 77343b72cb
commit d907cc6ceb
2 changed files with 6 additions and 1 deletions

View File

@ -1 +1 @@
d9ae476f33e842c5ed90ffa87e4eb038165c3de9
2503461a43a643bd0faf46d2fd78aa482a87c110

View File

@ -4529,6 +4529,11 @@
return idx+1 >= asSorting.length ? 0 : idx+1;
};
// Convert to 2D array if needed
if ( typeof sorting[0] === 'number' ) {
sorting = [ sorting ];
}
// If appending the sort then we are multi-column sorting
if ( append && settings.oFeatures.bSortMulti ) {
// Are we already doing some kind of sort on this column?