NumberField length

function initMonthLengthValue(){
//重载maxLength方法,只判断NumberField。key:COSSP_JIRA_CS3_611_20091209
Ext.form.NumberField.prototype.size= 2;  //要限制的长度
Ext.form.NumberField.prototype.initValue = function()
{
    if(this.value !== undefined){
        this.setValue(this.value);
    }else if(this.el.dom.value.length > 0){
        this.setValue(this.el.dom.value);
    }
    this.el.dom.size = this.size;
    if (!isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) {
    this.el.dom.maxLength = this.maxLength *1;
    }   
};
}

你可能感兴趣的:(ext,prototype)