Ext.onReady(function(){
Ext.apply(Ext.form.field.VTypes,{
daterange:function(val,field){
var date = field.parseDate(val);
if(!date)return false;
if(field.startDate){
var startDate = field.up("form").down("#"+field.startDate);
if(startDate.getValue() !== null && startDate.getValue() !== ""){
if(startDate.getValue() > date){
this.daterangeText = "结束日期不能小于开始日期";
return false;
}
}
}else if(field.endDate){
var endDate = field.up("form").down("#"+field.endDate);
if(endDate.getValue() !== null && endDate.getValue() !== ""){
Ext日期范围自定义验证
最新推荐文章于 2017-06-01 16:55:05 发布