Modifying cookie to store some extra parameter (other costimized setting) for state saving
Modifying cookie to store some extra parameter (other costimized setting) for state saving
mayurpatel
Posts: 10Questions: 0Answers: 0
How can I modify the cookie to store some extra parameters for e.g I have two combobox on my webpage I am interested to store these combobox values in state saving cookie.so when I get back to the page I'm able retained the combobox value
I have tried to edit cookie value string but it give me error while invoking
[quote]
"fnCookieCallback": function(sName, oData, sExpires, sPath) {
// Customise oData or sName or whatever else here
var cookieData = {}
cookieData.pageSettings = pageSettings;
cookieData.oData = oData;
return sName + "=" + JSON.stringify(cookieData) + "; expires=" + sExpires + "; path=" + sPath;
}
[/quote]
is there any way to read the cookie value on document.ready function ?? so I can read the pagesetting value before invoking the datatable.
Thanks
I have tried to edit cookie value string but it give me error while invoking
[quote]
"fnCookieCallback": function(sName, oData, sExpires, sPath) {
// Customise oData or sName or whatever else here
var cookieData = {}
cookieData.pageSettings = pageSettings;
cookieData.oData = oData;
return sName + "=" + JSON.stringify(cookieData) + "; expires=" + sExpires + "; path=" + sPath;
}
[/quote]
is there any way to read the cookie value on document.ready function ?? so I can read the pagesetting value before invoking the datatable.
Thanks
This discussion has been closed.
Replies
Allan
I have modified my code something like below
[code]
"fnCookieCallback": function(sName, oData, sExpires, sPath) {
// Customise oData or sName or whatever else here
oData.oPageSetting = pageSettings;
return sName + "=" + JSON.stringify(oData) + "; expires=" + sExpires + "; path=" + sPath;
}
[/code]
it's works for me I can able to store the page settings object value in query string
I want to retrieve this value (pageSettings) before invoking the data table because what ever I have stored in (pageSettings) that would be as a parameter to fetch data from database on initial load of the page.
I have tried to use _fnReadCookie method on document.ready function but it is giving me error
so How can I call this function ??
Allan