In JavaScript code of web application, the table sorter is defined by:
$("#my-table").tablesorter({
headers: {
1: {
sorter: false
}
},
widgets: ["saveSort"]
});
So when the page is refreshed the sorting of table is saved, but when browser is closed, the table backs to its original sorting. So what I want is to get how table is sorted and save it to database. Can someone suggest me how I can obtain the cookie(s), which stores how table is sorted?
Thanks
When the
saveSortwidget (demo) saves the information, it tests the browser for localStorage first, then if that isn’t available, it falls back to saving the sort to a cookie. So, you can either use the function built into the widgets file like this:or if you are using Chrome, go to that page and press F12. now click on the resources tab and look under “Local Storage”
The value may look a bit confusing, but it’s just a JSON format:
And it is broken down as follows:
So as you can see in the above data, it is saving sort information for two tables on one web page.