Pending Review
Last Updated: 18 Jan 2019 16:09 by ADMIN
Barry Burton
Created on: 18 Jan 2019 15:48
Category: Data Source
Type: Feature Request
1
AutoRefresh DataSource

This is more of a feature request...

If I want to refresh a datasource every 60 seconds, be it a grid, a dropdown, etc., I have to add a snippet of code something like this:

var interval = 60000;

         setInterval(function()

         {
             $("#my-grid").data("kendoGrid").dataSource.read();
         }, interval);

Yes, I realize this is trivial, but it would be nice if you could add an AutoRefresh function directly to the DataSource API that handled all of this under the covers.  Example:

           .DataSource(dataSource => dataSource
               .WebApi()
               .PageSize(20)
               .Model(model =>
               {
                   model.Id(m => m.StoreId);
               })
               .Read(read => read.Url(Url.HttpRouteUrl("GetData", null)).Data("additionalData"))
               .AutoRefresh(60) // seconds
               .Events(e => e.Error("onError"))
           )
1 comment
ADMIN
Veselin Tsvetanov
Posted on: 18 Jan 2019 16:09
Hi Barry,

Thank you for your suggestion. I have just converted the current thread to a feature request in our Feedback portal, so other developers will be able to discuss the idea and support it. I would also suggest you to cast your vote for it.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.