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

Promise chaining for kendo alert

3 Answers 288 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Roohi
Top achievements
Rank 1
Roohi asked on 20 Sep 2019, 11:25 AM

Hi,

Does anyone know if it's possible to chain promises on the click of the 'ok' button in kendo.alert(), like you can do with kendo.confirm()?

If not, is there any other way I can latch on the 'click ok' event for a kendo alert?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 24 Sep 2019, 07:37 AM

Hi Roohi,

The predefined Kendo Alert dialog does not return a promise. However, you could define the action of the alert and bind a click handler as follows:

<button id="showAlert">Show Alert</button>
<div id="alert"></div>
    
<script>
  $("#showAlert").click(function() {
    showAlert("hi");
  });
      
  function showAlert(message) {
    $("#alert").kendoAlert({
      messages:{
        okText: message
      },
      actions: [{
        text: "#: messages.okText #",
        action: function(e) {             
          console.log("clicked");
        }
      }]
    }).data("kendoAlert").open();
  };
 </script>

I have also prepared a Dojo example where the above approach is demonstrated:

I hope this helps. In case you have any additional questions, please let me know.

Regards,
Dimitar
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
Travis
Top achievements
Rank 1
answered on 14 Apr 2020, 11:11 PM

kendo.alert *should* return a promise.

 

Please add to back log.

 

Consistency is so import in these types of frameworks.

0
Dimitar
Telerik team
answered on 16 Apr 2020, 05:21 AM

Hello Travis,

I have logged this as a feature request in the Kendo UI Feedback Portal on your behalf from where you could start tracking its status:

Also, updated your Telerik points accordingly for submitting this feature request.

Regards,
Dimitar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Roohi
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Travis
Top achievements
Rank 1
Share this question
or