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

kendo model validation issue for grid detail template

1 Answer 31 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Zinith Patel
Top achievements
Rank 1
Zinith Patel asked on 30 Dec 2013, 12:48 PM
I have bound kendo grid using MVVM. In model I have defined required validation for FirstName field.
I have set editable=true for kendo grid.
If user will set blank value for FirstName, validation is fired and working fine.
But when I set detail template for grid and bind data to detail template on detailInit method of kendo grid, required validation is not working.
Is there any solution for this situation.

example link with working validation : http://jsfiddle.net/yzKqV/218/
example link with validation not working : http://jsfiddle.net/yzKqV/219/

Kindly do needful

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 30 Dec 2013, 02:07 PM
Hi Zinith,

The issue that you are facing is expected. The problem comes from the fact that when you edit the detail element (the input) and you blur it, the grid is automatically being redrawn and the validation is omitted. What you can do is to get a copy of the value using the toJSON() method, but then you will need to create a custom implementation that will copy the data from the input back to the model. Please check the following example:

http://jsbin.com/oPuyAtIW/2/edit

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Zinith Patel
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or