Bug regarding sSortingClass
Bug regarding sSortingClass
gacek
Posts: 1Questions: 0Answers: 0
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;
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;
This discussion has been closed.
Replies
Allan