Custom Edit Template validation for Delete

5 posts, 0 answers
  1. rajeswari
    rajeswari avatar
    3 posts
    Member since:
    Nov 2015

    Posted 20 Nov 2015 Link to this post

    Hi,

          I have a Kendo Scheduler where i am using Custom Edit Template using e.TemplateName. So when i double click on the event in the Scheduler, the custom template opens as pop up with Save,Cancel and Delete option. I have some field validation in the template. When i click on Save, it shows validation error if any and does not proceed further if there are any validation error, but when i click on Delete, it shows validation error if any but it proceeds further and shows delete confirmation dialogue box. 

    Can any one please tell me as how to perform validation check and prevent the delete operation from happening if there is any validation error.

     

    Thanks,
    Rajee

  2. rajeswari
    rajeswari avatar
    3 posts
    Member since:
    Nov 2015

    Posted 23 Nov 2015 in reply to rajeswari Link to this post

    Hi,

    Any solution for this problem?

     

    Thanks,

    Rajee

  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 24 Nov 2015 Link to this post

    Hello Rajee,

    The described behavior is expected. Basically, the validation errors are shown because the form inputs are blurred, but the deletion process does not require the form to be valid. The delete button will remove the event instance without the applied changes in the edit form. That is why the deletion is not prevented if there are errors and the Delete confirmation dialog is shown.

    The only way to prevent this behavior is to disable the "Delete" button if there are any validation errors. Please note that deletion is not related to the valid entries in the form anyway.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. rajeswari
    rajeswari avatar
    3 posts
    Member since:
    Nov 2015

    Posted 26 Nov 2015 in reply to Georgi Krustev Link to this post

    Hello Georgi,

              Thanks for your reply. Can you please tell me as how to check validation on Delete button click. I have scheduler_remove event, but how do i check if the form is valid there?

     

    Thanks,

    Rajee

  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 30 Nov 2015 Link to this post

    Hello Rajee,

    What you need to do is to get the Kendo UI Validator instance from the editor form: and check whether there are any errors. If there are any then you can prevent the deletion.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready