Search code examples
cordovakendo-uitelerik-appbuildereverlive

Kendo UI - save settings locally


I have some settings that are "bound" to a kendo observable, but they are APP-settings, so I don't want them to reset everytime the app is restarted. I want them to be saved, so they are stored in the app for the next time the user opens.

I can't find the setting to bind and save locally in the Kendo UI documentation though. So can I save the entire datamodel, or do I have to do something more manually?


Solution

  • I would suggest binding to the change method of your observable and writing it to a cookie. Then when you start up or come to the page read the cookie back into an observable. You should be able to serialize it to JSON to store in the cookie.

    Bind to change as shown here: http://docs.telerik.com/kendo-ui/api/javascript/data/observableobject#methods-bind

    Save to cookie as shown here: I want to store Javascript array as a Cookie