javascriptkendo-uikendo-gridkendo-validator

Kendo UI Grid custom validation message


Here is an example of working custom validation, but without an error message. To test it, set the value of "Lowest" to something higher to or equal to the row's "Highest" value.

The functionality I need is already working, I just can't figure out how to set a custom error message for my custom validator in a Kendo UI Grid.

Every example I find either has no custom message or uses a construct like the following, which does not work, at least not anymore from what I can tell:

{
  validation: {
    rules: {
      myCustomValidator: ...
    },
    messages: {
      myCustomValidator: 'My custom error message'
    }
  }
}

Any ideas?


Solution

  • Add the validation message as the value of the attribute "data-lowerThanHighest-msg" of the input text. You can do it like that: input.attr("data-lowerThanHighest-msg", "Lowest must be lower than Highest");

    See your demo revised here