Search code examples
kendo-uikendo-mobile

How to use kendo ui local storage as back end for my hybrid app


I am new to Kendo UI Mobile. This may be very simple but I don't know what to do. So only asking here. Now I'm trying to save some data into local storage but I don't know how to do. Please help me to fix this issue. Thanks in advance.


Solution

  • Here is a very simple example of using local storage with a kendo datasource.

    Load objects into storage

    localStorage.setItem(p.name, JSON.stringify(p));
    

    Get Objects out of storage

    for(var i=0; i< localStorage.length; i++) {
    var key = localStorage.key(i);
    people.push(JSON.parse(localStorage[key]));
    

    }

    See working sample http://jsbin.com/AruGAMu/1/edit

    For more information on using local Storage with Kendo, you might want to check out JayData. They have some awesome tutorials on how to get started with whatever you want to use for a data store (local storage included). http://jaydata.org/ If you go with jaydata here is a blog post from the Kendo guys about using JayData with Kendo. http://www.kendoui.com/blogs/teamblog/posts/13-03-26/introducing-jaydata-and-kendo-ui.aspx