[Kendo UI Grid (Kendo Validator)]Cannot read property 'validate' of undefined

349 Views Asked by At

I have a problem with the kendo validator. So, I have a grid with cell editing and when I clicking on cell (focusing) I have one DOM structure of cell element

<td class="k-dirty-cell k-edit-cell" role="gridcell" data-role="editable">
    <span class="k-widget k-maskedtextbox" style="">
        <input name="ZipCode" data-val-required="Can not be empty" data-val-zipcodeentered="Enter 5 digits" data-val-zipcodewithdata="No data found" data-value-primitive="true" data-bind="value:ZipCode" data-role="maskedtextbox" class="k-textbox" autocomplete="off" style="width: 100%;">
<span class="k-icon k-i-warning">
</span></span>
</td>

When I unfocus I get other structure.

<td class="k-dirty-cell" role="gridcell">
    <span class="k-dirty"></span>
12343
</td>

And when I input 5 digits I send request and on 'onsuccess' event of ajax I handle response via kendoValidator to send response on UI in cell

zipInput.closest(".k-edit-cell").data("kendoValidator").validate(zipInput);

Zip input just an input cell

var zipInput = $(`<input name='ZipCode' data-val-required='Can not be empty' data-val-zipCodeEntered='Enter ${zipCodeMask.length} digits' data-val-zipCodeWithData='No data found' data-value-primitive='true' data-bind='value:${options.field}'/>`);

enter image description here But kendoValidator doesn`t not validate anything else fields besides input fields, how I can handle this validation?

0

There are 0 best solutions below