Eds
Eds

Reputation: 157

Custom Validation in Kendo UI grid popup

I have set the min and max on a datepicker in a Kendo UI popup editor. This means that only the valid date range in the calendar is selectable. - That works fine. The problem is that it is still possible to manually enter a date outside of this range. I have added a custom validator which is called on a blur event and also when clicking the 'Update' button but the update button closes the popup and still updates the grid. Strangely if I step through the code with a debugger then it works as expected, the error message is displayed and the popup stays open Also my real code isn’t behaving exactly the same. The min and max on the picker do also appear to validate the manually entered text and stop the 'update'. The problem is that no validation message is displayed (or it disappears immediately), either for the min/max or the custom validation. I think that solving either of these 2 problems would fix the issue and be much appreciated. Please see this link for jsfiddle.net /eQ2j7/65/

Thanks, Eds

Upvotes: 1

Views: 2585

Answers (1)

Bishnu Rawal
Bishnu Rawal

Reputation: 1387

You can hide/unhide the update button upon validation errors with $('.k-grid-update').css('display', 'none');. I have updated your fiddle, please have a look.

Upvotes: 1

Related Questions