Load grid when offline

3 posts, 1 answers
  1. Scott Waye
    Scott Waye avatar
    150 posts
    Member since:
    Nov 2009

    Posted 18 Feb 2016 Link to this post

    Hi,

     

    I want to load the grid from an offline source like in this example, http://stackoverflow.com/questions/12980444/caching-a-kendo-ui-datasource-object-using-localstorage.   However that example is using KendoUI directly, whereas I am creating the grid using the MVC HtmlHelper.  In the helper there is no overload on the Read method on the DataSource to specify a javascript function.  How do I do the equivalent with the HtmlHelper, or do I need to mix and match?
  2. Answer
    Vasil
    Admin
    Vasil avatar
    1603 posts

    Posted 22 Feb 2016 Link to this post

    Hi Scott,

    JavaScript method can be set for the Read property using custom ClientHandlerDescriptor.

    .Transport(new {
       read = new Kendo.Mvc.ClientHandlerDescriptor() {HandlerName = "customRead" }
    })

    function customRead(options) {
       options.success(yourCustomData);
    }

    You can find additional information here: http://docs.telerik.com/kendo-ui/aspnet-mvc/custom-datasource#custom-datasource

    Regards,
    Vasil
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Scott Waye
    Scott Waye avatar
    150 posts
    Member since:
    Nov 2009

    Posted 22 Feb 2016 in reply to Vasil Link to this post

    Thanks, that is what I was looking for.
Back to Top