mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Fix: Column sorting classes might not be applied correctly
- If you use multiple column definations such that a columns' sorting options are initially disabled and then enabled, the sorting classes for the header were not being applied correctly. - The fix is to always assign classes based on the most up-to-date information for the column. - This fixes DataTables/DataTables #303
This commit is contained in:
parent
efa8ff5b71
commit
f51f88429d
@ -1 +1 @@
|
||||
fd6a64289e82e811d542745a632496ded845f90c
|
||||
49c27c14b0bd6fee5b1d4e26d9a5ede0f36d4867
|
||||
|
7
media/js/jquery.dataTables.js
vendored
7
media/js/jquery.dataTables.js
vendored
@ -516,8 +516,6 @@
|
||||
var oDefaults = DataTable.defaults.column;
|
||||
var iCol = oSettings.aoColumns.length;
|
||||
var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
|
||||
"sSortingClass": oSettings.oClasses.sSortable,
|
||||
"sSortingClassJUI": oSettings.oClasses.sSortJUI,
|
||||
"nTh": nTh ? nTh : document.createElement('th'),
|
||||
"sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '',
|
||||
"aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],
|
||||
@ -671,6 +669,11 @@
|
||||
oCol.sSortingClass = oClasses.sSortableDesc;
|
||||
oCol.sSortingClassJUI = oClasses.sSortJUIDescAllowed;
|
||||
}
|
||||
else
|
||||
{
|
||||
oCol.sSortingClass = oClasses.sSortable;
|
||||
oCol.sSortingClassJUI = oClasses.sSortJUI;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user