Validation before action execute

3 posts, 1 answers
  1. Justin
    Justin avatar
    2 posts
    Member since:
    Nov 2017

    Posted 09 Feb 2018 Link to this post

    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?




  2. Answer
    Neli avatar
    397 posts

    Posted 12 Feb 2018 Link to this post

    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.

    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.
  3. Justin
    Justin avatar
    2 posts
    Member since:
    Nov 2017

    Posted 15 Feb 2018 in reply to Neli Link to this post

    That works! 


    Thanks Neli!

Back to Top