我现在有一个问题,我有一个只有两种日期类型的可编辑字段的 Kendo UI Grid,到目前为止一切正常。给我的问题是验证开始日期和结束日期。日期必须始终小于或等于结束日期。我需要验证这两个字段。有想法的人谢谢
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: controller + "/read",
type: "GET"
},
update: {
url: controller + "/update",
type: "POST",
dataType: "json"
//data: { model: "prueba" }
},
destroy: {
url: controller + "/delete",
dataType: "json",
type: "POST"
}
},
batch: true,
//pageSize: 10,
schema: {
model: {
id: "id_POSPlanningOpe",
fields: {
select: { type: "boolean", editable: false },
id_POSPlanningOpe: { editable: false, nullable: true },
codPdv: { editable: false },
nombrePdv: { editable: false },
regionPdv: { editable: false },
zonapdv: { editable: false },
fecha_Inicio: { type: "date", editable: true },
fecha_Fin: { type: "date", editable: true },
estado: { editable: false }
}
}
}
});
$("#grid").kendoGrid({
selectable: "multiple",
sortable: {
mode: 'single',
allowUnsort: false
},
dataSource: dataSource,
height: 500,
toolbar: [
{ name: "save", text: "Grabar" },
{ name: "cancel", text: "Cancelar" }],
columns: [
{ title: "<span></span>", width: "20px", template: '<input type="checkbox" name="CheckRow" value="#= id_POSPlanningOpe #"></input>' },
{ field: "id_POSPlanningOpe", title: "<span class='Cabecera'>NRORUTA</span>", width: 80 },
{ field: "codPdv", title: "<span class='Cabecera'>CODIGO PDV</span>", width: 100 },
{ field: "nombrePdv", title: "<span class='Cabecera'>NOMBRE</span>" },
{ field: "regionPdv", title: "<span class='Cabecera'>REGION</span>" },
{ field: "zonapdv", title: "<span class='Cabecera'>ZONA</span>" },
{ field: "fecha_Inicio", title: "<span class='Cabecera'>FECHA INICIO</span>", template: '#= kendo.toString(fecha_Inicio,"dd/MM/yyyy") #', width: 100 },
{ field: "fecha_Fin", title: "<span class='Cabecera'>FECHA FIN</span>", template: '#= kendo.toString(fecha_Fin,"dd/MM/yyyy") #', width: 100 },
{ field: "estado", title: "<span class='Cabecera'>ESTADO</span>", width: 80 },
{ command: ["edit"], title: " ", width: "100px" }],
editable: 'inline'
});