how to validate a number field in kendo gride .
CostPrice: { editable: true, type: "number",validation: { required: true}}
how to validate a date field in kendo gride.
var date = new Date();
var currentYear = date.getFullYear();
var mindate = "01/01/" + currentYear;
var maxdate = "12/31/" + currentYear;
schema: {
data: "Data",
total: "Total",
errors: "Errors",
model: {
id: "Id",
fields: {
Date: { editable: true, type: "date", format: "{0:MM/dd/yyyy}", validation: { required: true, min: new Date(mindate), max: new Date(maxdate) } },
Month: { editable: false, type: "string" },
HolidayName: {
editable: true, type: "string", validation: {
required: true,
maxlength:
function (input) {
if (input.val().length > 80) {
input.attr("data-maxlength-msg", "Max length is 80");
return false;
}
return true;
}
}
},
Id: { editable: false, type: "number" }
}
}
},
CostPrice: { editable: true, type: "number",validation: { required: true}}
how to validate a date field in kendo gride.
var date = new Date();
var currentYear = date.getFullYear();
var mindate = "01/01/" + currentYear;
var maxdate = "12/31/" + currentYear;
schema: {
data: "Data",
total: "Total",
errors: "Errors",
model: {
id: "Id",
fields: {
Date: { editable: true, type: "date", format: "{0:MM/dd/yyyy}", validation: { required: true, min: new Date(mindate), max: new Date(maxdate) } },
Month: { editable: false, type: "string" },
HolidayName: {
editable: true, type: "string", validation: {
required: true,
maxlength:
function (input) {
if (input.val().length > 80) {
input.attr("data-maxlength-msg", "Max length is 80");
return false;
}
return true;
}
}
},
Id: { editable: false, type: "number" }
}
}
},
}