Dear Telerik,
I have a Kendo Grid with a kendoComboBox column.
The kendoComboBox is filled with remote JSON-Data and the input's 'required'-property is added. ('<input required ).
The validation of the required property is working, but only after I first focused the combobox-column or I first selected the combobox.
When I do not touch the combobox-column and click the save-button immediately, the validation is not done and the server gets an empty value.
Is there a way to validate and display the required message underneath the combobox after pressing the save button ?
Regards,
Henri
4 Answers, 1 is accepted
Based on the provided information, I assume that the used edit mode is "InCell", am I correct? If so, the reason why the validation is not triggered is that the validator depends on an input element and triggers the validation based on the value of the input. When "InCell" edit mode is used, there are no inputs rendered. The validation will be triggered once the cell has been opened for editing.
That said, the validation has to be handled manually in the saveChanges event of the grid. An example of how this can be achieved can be found here:
https://dojo.telerik.com/ifezAJut
In comparison, if you make use of the "InLine" edit mode, the validation would be triggered as expected because all of the cells are opened for editing:
https://dojo.telerik.com/ovERifel
Kind regards,
Tsvetomir
Progress Telerik

Dear Tsvetomir,
thx for the exemple, but I have one issue ?
My Compiler generates an error on de 'raw'-array -> Errormessage = 'raw' is not defined no-undef
The Raw-Array is used in de .Reduce-Part.
Should it be replaced with 'rawCustomRules' ?
thx,
Gert
.reduce((obj, key) => {
obj[key] = raw[key];
return obj;
}, {});

Dear Telerik,
can you please have a look at the compile-error (raw' is not defined no-undef) in the Dojo Exemple https://dojo.telerik.com/ifezAJut
Line 106 obj[key] = raw[key];
Thx,
Henri
The error is expected if strict mode is enabled or JSLint is used for checking the code. This is because on row 106 a row variable is used. However, it is not defined in the code and that will result in an error.
In the provided Dojo I have not used a custom rule which means that the comparison would not happen, hence, not throwing an exception. It is a typo and the actual comparison has to happen against the "rawCustomRules" collection.
.reduce((obj, key) => {
debugger;
obj[key] = rawCustomRules[key];
return
obj;
Kind regards,
Tsvetomir
Progress Telerik