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

Is it possible to trigger a field validator, from js function

2 Answers 243 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Yaniv
Top achievements
Rank 1
Yaniv asked on 05 Nov 2013, 01:35 PM
Hi
i have defined a custom validator in model field,
this is working fine...

01.schema: {
02.    model: {
03.        id: "EventId",
04.        fields: {
05.            Remarks: {
06.                type: "string",
07.                validation: {
08.                    validateTextLength: function (input) {
09.                        var statusRemarks = input.data("kendoEditor");
10.                        return statusRemarks != null &&
11.                             statusRemarks.value().length < 100;
12.                        }
13.                }
14.            },

is it possible to trigger this validation in a javascript function

thanks Yaniv

2 Answers, 1 is accepted

Sort by
0
Yaniv
Top achievements
Rank 1
answered on 06 Nov 2013, 06:37 AM
Found a solution if anyone run into that kind of problem
for the parent grid you can do :
$("#eGrid").getKendoGrid().editable.validatable.validate();
0
Kiril Nikolov
Telerik team
answered on 06 Nov 2013, 08:11 AM
Hello Yaniv,

Yes you can call the validate() method in order to invoke the validation programatically. 

Thank you very much for sharing this, so other people having the same issue can read it!
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
Yaniv
Top achievements
Rank 1
Answers by
Yaniv
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or