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

Formatted value numeric input missing k-invalid class

1 Answer 544 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Paweł
Top achievements
Rank 1
Paweł asked on 04 Oct 2016, 07:07 AM

Hi,

I noticed, that when using a validation for kendo grid fields, only some fields get the k-invalid class. This can be easily seen on the demo page: http://demos.telerik.com/kendo-ui/grid/editing-custom-validation .

All the empty fields are correctly validated, but only ProductName fields has the k-invalid class. The Unit Price and Units In Stock don't (they still kave the k-valid class, although there is tooltip saying that field is required). So my problem is that I want to style invalid fields with red background etc, and it simply doesn't work for numeric fields.

Is that a known issue? Any workarounds for now?

 

Thanks,

Pawel

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 05 Oct 2016, 02:21 PM
Hi Paweł,

The described behavior is caused by the fact that some widgets (like the Kendo NumericTextBox) have complex rendering mechanisms, and behind the scenes create and use additional DOM elements:

http://docs.telerik.com/kendo-ui/controls/editors/numerictextbox/overview#getting-started

You can check out the following how-to article from our documentation for an universal approach for marking both inputs and widgets that have failed validation with a red border:

http://docs.telerik.com/kendo-ui/controls/editors/validator/how-to/use-mutation-observer

I hope this helps.

Regards,
Dimiter Topalov
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Validation
Asked by
Paweł
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or