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

Validation before action execute

2 Answers 50 Views
Dialog
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 09 Feb 2018, 05:46 PM

We have a dialog where a user needs to select an item from a drop down list.  The dialog has an OK and Cancel button.  We want to validate the selection when the user clicks OK but not when they click cancel.  Is there a way I can do this with actions or is the only alternative to add buttons as content and handle the close on our own?

 

Thanks,

~Justin

2 Answers, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 12 Feb 2018, 03:19 PM
Hello Justin,

In order to achieve the desired behavior you can use the actions.action configuration. In the callback function, you can implement the needed validation.
In the linked Dojo example a DropDownList is nested in Kendo Dialog. When the 'OK' button is clicked, the text of the currently selected item is retrieved. In case the text is shorter than 10 characters, an alert will appear and the returned result will be 'false'.

I hope that the provided example will be helpful.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Justin
Top achievements
Rank 1
answered on 15 Feb 2018, 01:51 PM

That works! 

 

Thanks Neli!

Tags
Dialog
Asked by
Justin
Top achievements
Rank 1
Answers by
Neli
Telerik team
Justin
Top achievements
Rank 1
Share this question
or