This is a migrated thread and some comments may be shown as answers.

Load grid when offline

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Veteran
Iron
Scott Waye asked on 18 Feb 2016, 08:35 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Vasil
Telerik team
answered on 22 Feb 2016, 09:10 AM
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
0
Scott Waye
Top achievements
Rank 2
Veteran
Iron
answered on 22 Feb 2016, 01:55 PM
Thanks, that is what I was looking for.
Tags
Grid
Asked by
Scott Waye
Top achievements
Rank 2
Veteran
Iron
Answers by
Vasil
Telerik team
Scott Waye
Top achievements
Rank 2
Veteran
Iron
Share this question
or