mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-18 11:52:11 +01:00
Fixed: State saving when there were no column being sorted was broken - 2914
This commit is contained in:
parent
2315bf3635
commit
81107d0b7d
@ -14,7 +14,8 @@
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"bStateSave": true
|
||||
"bStateSave": true,
|
||||
"aaSorting": []
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
1
media/js/jquery.dataTables.js
vendored
1
media/js/jquery.dataTables.js
vendored
@ -5778,6 +5778,7 @@
|
||||
sValue += "]";
|
||||
|
||||
sValue += "}";
|
||||
|
||||
_fnCreateCookie( oSettings.sCookiePrefix+oSettings.sInstance, sValue,
|
||||
oSettings.iCookieDuration, oSettings.sCookiePrefix, oSettings.fnCookieCallback );
|
||||
}
|
||||
|
38
media/unit_testing/tests_onhold/1_dom/2914-state-save-sort.js
Executable file
38
media/unit_testing/tests_onhold/1_dom/2914-state-save-sort.js
Executable file
@ -0,0 +1,38 @@
|
||||
// DATA_TEMPLATE: dom_data
|
||||
oTest.fnStart( "2914 - State saving with an empty array" );
|
||||
|
||||
$(document).ready( function () {
|
||||
document.cookie = "";
|
||||
$('#example').dataTable( {
|
||||
"bStateSave": true,
|
||||
"aaSorting": []
|
||||
} );
|
||||
|
||||
oTest.fnTest(
|
||||
"No sort",
|
||||
null,
|
||||
function () { return $('#example tbody td:eq(3)').html() == "4"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Next page",
|
||||
function () {
|
||||
$('#example').dataTable().fnPageChange( 'next' );
|
||||
},
|
||||
function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Destroy the table and remake it - checking we are still on the next page",
|
||||
function () {
|
||||
$('#example').dataTable( {
|
||||
"bStateSave": true,
|
||||
"aaSorting": [],
|
||||
"bDestroy": true
|
||||
} );
|
||||
},
|
||||
function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
|
||||
);
|
||||
|
||||
oTest.fnComplete();
|
||||
} );
|
Loading…
x
Reference in New Issue
Block a user