Extjs407 getValue()和getRawValue() 区别

来源:互联网 发布:荆鹏软件 编辑:程序博客网 时间:2024/05/16 08:37

例子:

         {
                xtype: 'datefield',
                width: 100,
                id: 'mydate',
                format: 'Y-m-d',
                value: new Date(),
                msgTarget: 'side',
                emptyText: '请选择日期。。。',
                name: 'mydate'
            }


mydate.value 和getvalue() 一样的。

mydate.getvalue() 返回的是对象: Wed Mar 07 2007 00:00:00 GMT+0100

也可以用以下方法格式化:mydate.formatDate(myDate.getValue())) : 2007-03-07


mydate.getRawValue() 返回的是该控件的显示值:2007-03-07   (如果控件定义了格式的,择返回该格式字符串)

原创粉丝点击