{
field: "startDate",
title: '开始时间',
headerAttributes: {
"class": "table-header-cell",
style: "text-align: center"
},
attributes:{style: "white-space:nowrap;text-overflow:ellipsis;"},
width: 120,
format: "{0:yyyy-MM-dd}",
editor: function(container, options) {
var end = options.model.endDate;
var d;
if(end){
d=end;
}
$('<input name="' + options.field + '"/>')
.appendTo(container)
.kendoDatePicker({
format:"yyyy-MM-dd",
max:d,
change:function(){
if(this.value()!=){
d = this.value();
}else{
d= new Date(1900, 0, 1, 22, 0, 0);
}
}
});
}
},
{
field: "endDate",
title: '结束时间',
headerAttributes: {
"class": "table-header-cell",
style: "text-align: center"
},
attributes:{style: "white-space:nowrap;text-overflow:ellipsis;"},
width: 120,
format: "{0:yyyy-MM-dd}",
editor: function(container, options) {
var start = options.model.startDate;
var d;
if(start){
d=start;
}
$('<input name="' + options.field + '"/>')
.appendTo(container)
.kendoDatePicker({
format:"yyyy-MM-dd",
min:d,
change:function(){
if(this.value()!=){
d = this.value();
}else{
d= new Date(2099, 0, 1, 22, 0, 0);
}
}
});
}
},
转载于:https://www.cnblogs.com/chengshixiaonongming/p/10372815.html