ext日期控件怎么在html里面写

2025-04-29 07:36:05
推荐回答(1个)
回答1:

dateTimeField_s.js 代码
 
Ext.form.DateTimeField = Ext.extend(Ext.form.TriggerField,  {
    format : "m/d/Y H:i:s",
    altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",
    disabledDays : null,
    disabledDaysText : "Disabled",
    disabledDates : null,
    disabledDatesText : "Disabled",
    minValue : null,
    maxValue : null,
    minText : "The date in this field must be equal to or after {0}",
    maxText : "The date in this field must be equal to or before {0}",
    invalidText : "{0} is not a valid date - it must be in the format {1}",
    triggerClass : 'x-form-date-trigger',

        defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"},

    initComponent : function(){
        Ext.form.DateTimeField.superclass.initComponent.call(this);
        if(typeof this.minValue == "string"){
            this.minValue = this.parseDate(this.minValue);
        }
        if(typeof this.maxValue == "string"){
            this.maxValue = this.parseDate(this.maxValue);
        }
        this.ddMatch = null;
        if(this.disabledDates){
            var dd = this.disabledDates;
            var re = "(?:";
            for(var i = 0; i < dd.length; i++){
                re += dd[i];
                if(i != dd.length-1) re += "|";
            }
            this.ddMatch = new RegExp(re + ")");
        }
    },