简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM