隐藏 Ext.form.DateField 的触发(trigger)元素使其内容不能修改并使其所有的文本框(text field)显示格式为Y-m-d(2009-06-18):
1 隐藏 Ext.form.DateField 的触发(trigger)元素
items : [{
xtype : '
datefield
',
fieldLabel : '开始日期',
name : 'fillinDate',
id : 'fillinDate',
format: '
Y-m-d
',
hideTrigger: true,
// True to hide the trigger element and display only the base text field(defaults to false)
readOnly: true
,
anchor : '95%'
}]
2 使 DateField 所有的文本框(text field)显示格式为Y-m-d(2009-06-18),只要在 js 文件的开头加以下代码即可:
Ext.apply(Ext.form.DateField.prototype, {
altFormats :'Y-m-dTH:i:s',
format :'Y-m-d'
});
有关 prototype 的内容是值得去学的,这对更好应用 Javascript 语言是很有帮助的,还有正则表达式的内容。
版权声明:
如果大家要转载本文,我非常荣幸。但请参加转载网址,谢谢!
本文介绍如何在Ext.form.DateField中隐藏触发元素,并设置所有文本框的显示格式为Y-m-d。通过设置hideTrigger为true及调整Ext.form.DateField的原型属性实现。
4077

被折叠的 条评论
为什么被折叠?



