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

Cursor Wait on RadButton Click

4 Answers 411 Views
Button
This is a migrated thread and some comments may be shown as answers.
Glenn
Top achievements
Rank 1
Glenn asked on 18 Jun 2015, 08:08 AM

Have Radbutton on page displayed in Radwindow with OnClientClicking function:

 

function OnClientClicking(sender, args) {
                  document.getElementById('<%=form1.ClientID%>').style.cursor = 'wait';
                            }

The RadButton submits postback, but their is sometimes a delay.

The wait cursor displays when hovering on parts of the form that don't include controls (buttons, input controls)

Is there anyway to have the wait cursor show over the Radbutton as well, or all the controls would be better.

Thanks

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Jun 2015, 03:51 PM

Hello Glenn,

Perhaps showing a RadAjaxLoadingPanel would be a more suitable solution, as it provides more consistent UI and will also consime any mouse clicks, while simply changing the cursor will not prevent clicks.

Nevertheless, I would suggest using a CSS class and a heavy enough selector so it overrides all child elements' own cursor properties. For example:

<telerik:RadButton ID="RadButton1" runat="server" Text="Postback" OnClientClicking="OnClientClicking" />
<script>
    function OnClientClicking(sender, args) {
        document.getElementById('<%=form1.ClientID%>').className = "waitingForm";
    }
</script>
.waitingForm,
.waitingForm *
{
    cursor: wait !important;
}


Regards,

Marin Bratanov
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
John
Top achievements
Rank 1
answered on 27 Aug 2019, 09:13 PM

That works for me if I specify a control on the page like;

function OnClientClicking(sender, args) {
                  document.getElementById('<%=radButton1.ClientID%>').style.cursor = 'wait';
                            }

 

It works just for the radButton though.

Specifying Form1 generates an error for. I guess since Form1 is defined in the master page. What if the form is defined in the master page, how do you get it's ClientId so the wait cursor covers everything?

 

 

0
Peter Milchev
Telerik team
answered on 28 Aug 2019, 08:41 AM

Hello John,

You can access the Form via the page's Form property: 

function OnClientClicking(sender, args) {
    document.getElementById('<%=Page.Form.ClientID%>').className = "waitingForm";
}

Regards,
Peter Milchev
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.
0
John
Top achievements
Rank 1
answered on 19 Nov 2019, 11:10 PM
Sorry, I didn't come back and let you know back in August that this worked out well for me. Thanks Peter.
Tags
Button
Asked by
Glenn
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
John
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or