From 3ce42db432b0420ec161c322ad04f8854a00b136 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 14 Apr 2014 09:28:36 +0100 Subject: [PATCH] Fix: Plug-in ordering didn't work on initial order - The resolution of unknown sorting types was being done after the sorting structure array of objects was being calculated. As such, a string sort was always being done in the first instance! - This fixes thread 20433 --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index c5194c91..45798f4c 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -528da3b2d730d076d579e6a6168e7cfcde776710 +d93e8e306c30875b8c3e94f291dc883befa2fa9f diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 8da19e13..6f9dac81 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -4305,13 +4305,15 @@ formatters = 0, sortCol, displayMaster = oSettings.aiDisplayMaster, - aSort = _fnSortFlatten( oSettings ); + aSort; // Resolve any column types that are unknown due to addition or invalidation // @todo Can this be moved into a 'data-ready' handler which is called when // data is going to be used in the table? _fnColumnTypes( oSettings ); + aSort = _fnSortFlatten( oSettings ) + for ( i=0, ien=aSort.length ; i