Bug regarding sSortingClass

Bug regarding sSortingClass

gacekgacek Posts: 1Questions: 0Answers: 0
edited July 2013 in Bug reports
Hi,

When I try to enable sorting selectively, sSortingClass is not set correctly on that column.
Example setup:

aoColumnDefs: [
{ bSortable: true, aTargets: [ 'col1'],
{ bSortable: false, aTargets: [ '_all' ] }
]

With such setup oCol.sSortingClass should be set to oSettings.oClasses.sSortable (function _fnColumnOptions), but it's not.
This patch fixes this issue: (against 1.9.4):

--- jquery.dataTables.js 2012-09-23 13:27:04.000000000 +0200
+++ jquery.dataTables.js 2013-07-11 13:03:46.000000000 +0200
@@ -197,7 +197,8 @@
oCol.sSortingClass = oSettings.oClasses.sSortableNone;
oCol.sSortingClassJUI = "";
}
- else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 )
+ else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1 ||
+ $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) != -1 )
{
oCol.sSortingClass = oSettings.oClasses.sSortable;
oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    This should actually be fixed in the 1.10 dev version in git already. Thanks for the patch though - I'll double check.

    Allan
This discussion has been closed.