I want to use custom validation for my editor
textbox. Yes, it can be done by adding required
inside textarea input, but I want to create my own custom message. Seem schema > model > validation
not working for field editor
. Is there a way to do this?
$("#grid").kendoGrid({
columns: [ {
field: "fieltext", title:"Field 1", editor: textboxeditor
} ],
editable: true,
scrollable: false,
dataSource: {
data: [ { num: 1 }, { num: 2 } ],
schema: {
model: {
fields: {
fieltext: { type: "number", validation: {required: {message: "This field is required"}} }
}
}
}
}
});
function textboxeditor(container, options) {
$('<textarea class="k-textbox" required style="height: 50px; min-height: 80px; width: 60%; margin: 5px 0px 5px 0px; padding: 5px; min-width:80%; max- width:80%" name="' + options.field + '" />').appendTo(container);
}