posts - 431,  comments - 344,  trackbacks - 0
Ext.override(Ext.form.DisplayField, {
    getValue : function(){
        return this.value;
    },
    setValue : function(v){
        this.value = v;
        this.setRawValue(this.formatValue(v));
        return this;
    },
    formatValue : function(v){
     if(this.dateFormat && Ext.isDate(v)){
      return v.dateFormat(this.dateFormat);
     }
     if(this.numberFormat && typeof v == 'number'){
      return Ext.util.Format.number(v, this.numberFormat);
     }
     return v;
    }
});


items:[{
     fieldLabel:'申购日期',
     xtype : 'displayfield',
     name : 'orderDate',
     formatValue: function(value){return new Date(value).format("Y-m-d");}
    }]
posted on 2009-11-30 22:25 周锐 阅读(1531) 评论(0)  编辑  收藏 所属分类: Ajax

只有注册用户登录后才能发表评论。


网站导航: