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

OnClientButtonClicking and async/await in JS

3 Answers 595 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Miroslav
Top achievements
Rank 1
Miroslav asked on 14 Jun 2019, 11:50 AM

Hello,

I have some javascript code hooked up to the RibbonBar OnClientButtonClicking event. There is a confirm() method to let the user confirm the action of the RibbonBar button. The result is a parameter for args.set_cancel(). It works nicely:

Now I want to replace the browser confirm popup box with custom jQuery dialog. But even when I use async/await and clearly see that the javascript function stops and waits for the user response, the RibbonBar goes on and continues with the action before args.set_cancel is called.

Is there a way to get around this?

3 Answers, 1 is accepted

Sort by
0
Miroslav
Top achievements
Rank 1
answered on 18 Jun 2019, 06:36 AM

Just talking to myself :D

This looks like it will solve my problem:

https://www.telerik.com/support/whats-new/aspnet-ajax

 

But in the meantime if anyone knows other solution, I would be thankful the help.

0
Miroslav
Top achievements
Rank 1
answered on 18 Jun 2019, 06:40 AM
"New Confirm Dialog in Rad Button

A highly requested feature that allows you to easily ask the client for confirmation with RadWindow dialogs before triggering a post back. Your app’s users can feel safer in their UX and will have the opportunity to verify their details and no longer worry about submitting incorrect information."
0
Vessy
Telerik team
answered on 19 Jun 2019, 08:48 AM
Hi Miroslav,

The best option is to upgrade to our latest release and use the newly introduced Confirm Dialog functionality. If the upgrading is not an option for some reasons, you can try with the approach given here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/confirm-closing#using-the-radconfirm-dialog

Regards,
Vessy
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.
Tags
RibbonBar
Asked by
Miroslav
Top achievements
Rank 1
Answers by
Miroslav
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or