Ext.form.TextArea
中有一个emptyText
配置选项。
文档:
默认情况下,如果字段为空,则将默认文本放置在其中(默认为 null)。注意:如果启用此字段并配置名称,则此值将提交到服务器。
Ext 4.2.2 的文档:
在空字段中放置默认文本。Ext.form.Basic.submit
的submitEmptyText
选项设置为false。inputType: 'file'
,则不支持emptyText
,应避免使用它。emptyText
值。请使用以下内容:
xtype: 'textfield',
placeHolder: 'Please Enter Something'
emptyText
属性。xtype: 'textfield',
label: 'Try KeyDown',
emptyText: 'Press Enter/Return here...',
name: 'email',
animateUnderline : true
emptyText配置选项有效,正如@e-zinc所指出的那样。但是,它并不清除值。这里有一个修复方法。
initComponent: function () {
var me = this;
me.on('focus', function () {
if(!me.isDirty()) {
me.setValue('');
}
});
me.callParent(arguments);
}