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

Custom Edit Template validation for Delete

4 Answers 244 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
rajeswari
Top achievements
Rank 1
rajeswari asked on 20 Nov 2015, 11:53 AM

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

4 Answers, 1 is accepted

Sort by
0
rajeswari
Top achievements
Rank 1
answered on 23 Nov 2015, 11:32 AM

Hi,

Any solution for this problem?

 

Thanks,

Rajee

0
Georgi Krustev
Telerik team
answered on 24 Nov 2015, 09:54 AM
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!
 
0
rajeswari
Top achievements
Rank 1
answered on 26 Nov 2015, 08:22 AM

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

0
Georgi Krustev
Telerik team
answered on 30 Nov 2015, 07:43 AM
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!
 
Tags
Scheduler
Asked by
rajeswari
Top achievements
Rank 1
Answers by
rajeswari
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or