mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Dev fix: State saving was breaking on sort
- My fix a while back for detecting if a column was no longer available in a table was duff, since it used $.map which flattens its array return, but sorting needs a 2D array. - Fixed by doing our own itteration
This commit is contained in:
parent
6447373eb6
commit
f817e9a0be
@ -1 +1 @@
|
||||
da2fd7496f9b3af515df83a26c61c05d9451ae42
|
||||
06352304626267c445f0816cdf446860af77e721
|
||||
|
12
media/js/jquery.dataTables.js
vendored
12
media/js/jquery.dataTables.js
vendored
@ -4319,9 +4319,15 @@
|
||||
oSettings._iDisplayStart = oData.iStart;
|
||||
oSettings.iInitDisplayStart = oData.iStart;
|
||||
oSettings._iDisplayLength = oData.iLength;
|
||||
oSettings.aaSorting = $.map( oData.aaSorting, function (d) {
|
||||
return d[0] >= columns.length ? [ 0, columns[i].asSorting[0] ] : d;
|
||||
} );
|
||||
oSettings.aaSorting = [];
|
||||
|
||||
var savedSort = oData.aaSorting;
|
||||
for ( i=0, ien=savedSort.length ; i<ien ; i++ ) {
|
||||
oSettings.aaSorting.push( savedSort[i][0] >= columns.length ?
|
||||
[ 0, savedSort[i][1] ] :
|
||||
savedSort[i]
|
||||
);
|
||||
}
|
||||
|
||||
/* Search filtering */
|
||||
$.extend( oSettings.oPreviousSearch, oData.oSearch );
|
||||
|
Loading…
x
Reference in New Issue
Block a user