1 // DATA_TEMPLATE: dom_data
2 oTest.fnStart( "Cookie callback" );
5 $(document).ready( function () {
7 /* Note that in order to be fully effective here for saving state, there would need to be a
8 * stringify function to serialise the data array
14 $('#example').dataTable();
16 function () { return $('#example').dataTable().fnSettings().fnCookieCallback == null; }
20 "Number of arguments",
22 $('#example').dataTable( {
25 "fnCookieCallback": function (sName, oData, sExpires, sPath) {
26 mPass = arguments.length;
27 return sName + "=; expires=" + sExpires +"; path=" + sPath;
31 function () { return mPass == 4; }
37 $('#example').dataTable( {
40 "fnCookieCallback": function (sName, oData, sExpires, sPath) {
41 mPass = sName=="SpryMedia_DataTables_example_dom_data.php";
42 return sName + "=; expires=" + sExpires +"; path=" + sPath;
46 function () { return mPass; }
52 $('#example').dataTable( {
55 "fnCookieCallback": function (sName, oData, sExpires, sPath) {
56 mPass = typeof oData.iStart != 'undefined';
57 return sName + "=; expires=" + sExpires +"; path=" + sPath;
61 function () { return mPass; }
67 $('#example').dataTable( {
70 "fnCookieCallback": function (sName, oData, sExpires, sPath) {
71 mPass = typeof sExpires == 'string';
72 return sName + "=; expires=" + sExpires +"; path=" + sPath;
76 function () { return mPass; }
82 $('#example').dataTable( {
85 "fnCookieCallback": function (sName, oData, sExpires, sPath) {
86 mPass = sPath.match(/media\/unit_testing\/templates/);
87 return sName + "=; expires=" + sExpires +"; path=" + sPath;
91 function () { return mPass; }
95 oTest.fnCookieDestroy( $('#example').dataTable() );