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

Custom validation called multiple times

5 Answers 895 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 19 Jan 2015, 01:03 PM
Custom validation is called twice for a single input field. When navigatable/selectable configuration is set and enter is pressed the row is saved and validation is called three times for a single input field.

http://dojo.telerik.com/oxeKE

5 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 21 Jan 2015, 10:18 AM
Hi Ryan,

Calling the validation functions twice is expected in this case, because pressing Enter with the navigatable option enabled is trying to save the changes. First, the validation is called because the input element lost focus, next it is called because the row is being saved. 

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ryan
Top achievements
Rank 1
answered on 21 Jan 2015, 12:24 PM
I expect that as well for navigatable but it isn't being called twice - its being called three times. Here's a demo without navigatable that shows validation erroneously being called twice. http://dojo.telerik.com/oxeKE/2
0
Alexander Popov
Telerik team
answered on 23 Jan 2015, 09:18 AM
Hello again Ryan,

Would you please let me know which browser you are using? I tried reproducing this with Chrome, Firefox and IE10, but the validation is called once in the second example and twice in the first.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ryan
Top achievements
Rank 1
answered on 23 Jan 2015, 12:43 PM
Hi Alex. Here's a video demonstrating the bug in all three browsers as well as their version numbers. I moved the console above the grid so I could record a smaller video. 

http://screencast.com/t/LuTn8tJ00n5g
http://dojo.telerik.com/oxeKE/3
0
Alexander Popov
Telerik team
answered on 27 Jan 2015, 09:54 AM
Hi Ryan,

I am not sure I understand your point correctly. You mentioned that this happens when pressing the Enter key, however the screencast shows that the update button is clicked. Clicking the button makes the input element lose focus, thus the Validation is triggered. It also tries to save the changes, triggering the Validation again. This is expected and is unlikely to change.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or