Declined
Last Updated: 14 Oct 2021 11:06 by ADMIN
Stacey
Created on: 20 Feb 2014 20:24
Category: Kendo UI for jQuery
Type: Feature Request
4
Include a catchable "errorDisplay" function
In followup to my last statement about adding data to the validation events, Kendo UI's validator would be greatly, greatly, GREATLY augmented with an extremely simple function...

onErrorDisplay(target, message, invalid) {

}


The sole purpose of this function is to allow users to hook into it, and custom handle error display more finely. It is fairly simple to add, look at line 11924 of the kendo source file; At Line 11948, there is the code to show the error message. The onErrorDisplay function would allow for catching that and interpreting it differently if requested.
6 comments
Luc
Posted on: 23 Oct 2014 13:39
You could also create your own validator widget based on kendo's. I have managed to do that and added these highlight, unhighlight and errorPlacement as events of the validator
ADMIN
Telerik Admin
Posted on: 01 Aug 2014 12:37
The status of this item has not changed, Ciel. Feel free to fork our Kendo UI Core github repository and submit a pull request with your add-hoc implementation, to be reviewed by our team.
Stacey
Posted on: 31 Jul 2014 15:42
Hey I was wondering if there has been any update on this. Would it help if I were to make a fork of the kendo source that implemented an ad-hoc version of this for you to see?
Stacey
Posted on: 25 Mar 2014 14:33
The problem is not the actual messages, those I knew we could customize. The problem is the way they are drawn to the screen.

Most of the time - especially in modern day web development where we want to be able to target mobile screen sizes, screen real estate is extremely important. For that reason, a simple baked solution of "add a div after the form element with the error message" is hardly sufficient.

Making things like tool tips has proven - while possible - far more difficult than it needs to be. In order to do tool tips for error messages, I basically had to insert a kendo template in the page that generates javascript code in line, and assign that template to the template part of the error validator.

Does this work? Yes. It does; But it's obscure, and obtuse. The ability to do javascript inline in templates is something I do not mind using, but it ought to be reserved for very important tasks that should require it - I'm of the personal opinion that something this trivial should not require it.

Take a look at how jQuery Validate handles its error displays; http://jqueryvalidation.org/validate/

Look at the `errorPlacement: function(error, element)` function. This, coupled with the `highlight` and `unhighlight` functions provides everything necessary to completely control every aspect of the way errors are presented to the user.
Stacey
Posted on: 22 Feb 2014 00:06
I do realize that there is the ability to do a custom template, but I truly feel this is not sufficient. I want - very, very badly - to use Kendo's Validator instead of jQuery Validate, because it works so seamlessly with the Kendo widgets without a lot of extra markup. But the limitation of having to do so much manual labor just to make it looks slightly different is extremely infuriating. I feel this is a very easy fix to make; If I felt that the Kendo team would ratify it into the final build, I may even try to do it myself and submit it - but it is an extremely simple change that would dramatically re-invent the usefulness of the validator because the user has a new, extremely flexible level of control over the output.

Right now, you have to use a template - which means some obscure javascript in some rather obtuse syntax, etc. etc. It works, sure... but it just doesn't work very well, for me.
ADMIN
Telerik Admin
Posted on: 21 Feb 2014 14:35
Thanks for sharing your idea, Ciel. I will pass it to our developers.

Meanwhile you can customize the displayed errors through custom error template and messages, as described here:
http://docs.telerik.com/kendo-ui/api/framework/validator#configuration-Defining