Edit this page

offlineStorage String |Object

The offline storage key or custom offline storage implementation.

Example - set offline storage key

<script>
var dataSource = new kendo.data.DataSource({
    offlineStorage: "products-offline",
    transport: {
        read: {
            url: "https://demos.telerik.com/kendo-ui/service/products",
            type: "jsonp"
        }
    }
});
</script>

Example - set custom offline storage implementation

<script>
var dataSource = new kendo.data.DataSource({
    // use sessionStorage instead of localStorage
    offlineStorage: {
        getItem: function() {
            return JSON.parse(sessionStorage.getItem("products-key"));
        },
        setItem: function(item) {
            sessionStorage.setItem("products-key", JSON.stringify(item));
        }
    },
    transport: {
        read: {
            url: "https://demos.telerik.com/kendo-ui/service/products",
            type: "jsonp"
        }
    }
});
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy