Chosing what to save in cookies when bStateSave is true
Chosing what to save in cookies when bStateSave is true
Hi Alan,
I have been using bStateSave on my website having multiple tables on the page. It saves in cookies the value on filtering also along with pagination. But I dont want the value of filtering text to be saved. Is there some way of telling datatables as to values for what parameters should be saved in the cookie?
I have been using bStateSave on my website having multiple tables on the page. It saves in cookies the value on filtering also along with pagination. But I dont want the value of filtering text to be saved. Is there some way of telling datatables as to values for what parameters should be saved in the cookie?
This discussion has been closed.
Replies
Allan
[code]
var table = $('.dataTable').dataTable( {
"bJQueryUI": true,
"bAutoWidth": false,
"bProcessing": true,
"bStateSave": true,
"jEditable": true,
"sPaginationType": "full_numbers",
"aaSorting": [[4,'asc']], /* PulledDateUtc */
"aoColumnDefs": [
{ "sType": "dwellTime", "aTargets":[6] },
{ "bSearchable": false, "aTargets":[3,5,7,-2,-1] }
],
"fnCookieCallback": function(sName, oData, sExpires, sPath) {
// Choose what to save in cookie and what not to
if (sName != 'sFilter')
return sName + "=" + JSON.stringify(oData) + "; expires=" + sExpires + "; path=" + sPath;
}
});
[/code]
After making this change, I have been getting the following error on the firebug console:
sData is not defined
[Break on this error] Y.location.pathname.split("/");a=a+"_"...{i=eval("("+decodeURIComponent(o[1])+ jquery....min.js (line 106)
After searching the forum I can make out that something is wrong with the initialisation but Iam not able to figure out what is wrong.