Does Kendo UI Grid expose a method to check if the model state is valid? -
i'm displaying kendo ui grid in modal. i've got few custom validations hooked working fine. when modal's "save" button clicked, need able check whether grid in valid or invalid state.
since i'm using custom validation, it's possible me keep running track of errors , check error count upon modal closing, hoping kendo ui grid kept , exposed easy mygrid.isvalid() or such thing.
if use web-api on server side call modelstate.isvalid
what mean custom validation
?
if using kendo custom validation
in reference reference way user cant enter wrong values in editor. if want isvalid option, way need impliment kendo.validator
. define validation rools in model , call validate()
:
// attach validator container , reference var validatable = $("#myform").kendovalidator().data("kendovalidator"); $("#save").click(function() { //validate input elements , check if there errors if (validatable.validate() === false) { // errors , write them out "errors" html container var errors = validatable.errors(); $(errors).each(function() { $("#errors").html(this); }); } });
Comments
Post a Comment