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

Refresh RadHtmlChart with Javascript and show loading spinner

3 Answers 377 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 29 Feb 2016, 09:02 PM

In case of RadGrid I can do this:

var RadGrid = $find('<%=RadGrid.ClientID %>').get_masterTableView();
RadGrid.fireCommand("Update", 0);

This refreshs my RadGrid and is showing the ajaxLoadingPanel with the spinner.

I try to do the same for RadHtmlChart like this:

var radHtmlChartObject = $find("<%=VersionsChart.ClientID %>");
radHtmlChartObject.repaint();
//or
radHtmlChartObject.loadData();

It refreshes/repaints the chart but I cannot see the loading animation. The RadAjaxManager is configured the same way for both controls, here for the RadHtmlChart:

<telerik:AjaxSetting AjaxControlID="VersionsChart">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="VersionsChart" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
</telerik:AjaxSetting>

How can I make the spinner appear also in case of the RadHtmlChart?

 

 

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 01 Mar 2016, 03:38 PM
Hello Michael,

Note that the fireCommand() client method is performing post to the server which is actually an Ajax request and therefore the LoadingPanel appears. When calling repaint() no request to the server is made therefore no Ajax is performed in this case.
You can try to invoke manual ajaxRequest if needed as shown below:
http://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/client-side-programming/overview


Regards,
Maria Ilieva
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
Michael
Top achievements
Rank 1
answered on 01 Mar 2016, 04:00 PM
Could you provide me with an example for my use case?
0
Michael
Top achievements
Rank 1
answered on 01 Mar 2016, 05:31 PM

got it.

function AjaxRequestButton(arguments) {
    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
    ajaxManager.ajaxRequestWithTarget('<%= Chart.UniqueID %>', '');
}

and in the RadAjaxManager:

<telerik:AjaxSetting AjaxControlID="AdminServiceVersionsChart" >
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="AdminServiceVersionsChart" />
    </UpdatedControls>
</telerik:AjaxSetting>

 

Tags
Ajax
Asked by
Michael
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Michael
Top achievements
Rank 1
Share this question
or