From d21a8529ee6b4cc1de40da4c993eec31be051528 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 23 Jun 2011 18:42:40 +0100 Subject: [PATCH] Fix: When complex expressions are built up with aoColumnDefs, resulting in the ability for a column to be turned "on and off" during initialisation, it would result in the column classes possibly not being correct for the sorting - 5472 - kudos to rups for this fix --- media/js/jquery.dataTables.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 6119c1e8..4386768f 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2623,6 +2623,12 @@ oCol.sSortingClass = oSettings.oClasses.sSortableNone; oCol.sSortingClassJUI = ""; } + else if ( oCol.bSortable || + ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) + { + oCol.sSortingClass = oSettings.oClasses.sSortable; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI; + } else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 ) { oCol.sSortingClass = oSettings.oClasses.sSortableAsc;