0

i saw that new kendo grid have built-in implemented filter persistence with localStorage.

$(function () {
    var grid = $("#grid").data("kendoGrid");

    $("#save").click(function (e) {
        e.preventDefault();
        localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());
    });

    $("#load").click(function (e) {
        e.preventDefault();
        var options = localStorage["kendo-grid-options"];
        if (options) {
            grid.setOptions(JSON.parse(options));
        }
    });
});

But is the localStorage implemented by cookies? How does it works, when getOptions and setOptions are called?

el1jaC
  • 1
  • 1
  • Maybe you can find some useful information in [this answer](http://stackoverflow.com/questions/9948284/how-persistent-is-localstorage) – OnaBai Dec 17 '14 at 17:11
  • Do a search for "html5 web storage" and read up on it. – Brett Dec 18 '14 at 16:17

1 Answers1

0

I think you were refering to "setItem(key,value)" and "getItem(key)". the setItem function is used for saving the value to the local storage and you will use the getItem() to get that value back by providing the key you supplied when saving.