I have a KendoUI chart generated with JavaScript. Is there a way to clear the plotArea with a command? For the purpose of showing a "Loading..." image while waiting for a DataSource to read remote data.
Thanks
Kendo UI is a bundle of four JavaScript UI libraries built natively for jQuery, Angular, React and Vue. Each is built with consistent API and theming, so no matter what you choose, your UI will be modern, responsive, accessible and fast.
Bind data to Kendo Grid by using AJAX Read action method. Change the datasource on change event of any HTML controls. Normally, a developer can bind the data to Grid by using AJAX Read method. This read method is ActionResult method in MVC which will return JSON DataSourceResult & direclty bind the data to Grid.
Displaying and hiding the loading animation is:
// Display progress
kendo.ui.progress($("#loading"), true);
// Hide progress
kendo.ui.progress($("#loading"), false);
Then you should use requestStart
and requestEnd
events in the DataSource
for knowing when to show or hide the progress animation.
The DataSource of the Chart would be:
dataSource : {
transport : {
read: {
url:...
}
},
sort : {
field: "year",
dir : "asc"
},
requestStart: function () {
kendo.ui.progress($("#loading"), true);
},
requestEnd : function () {
kendo.ui.progress($("#loading"), false);
}
},
Example here: http://jsfiddle.net/OnaBai/kcptr/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With