Extjs Datefield在一侧没有日期选择器

jjhzyzn0  于 2023-03-29  发布在  其他
关注(0)|答案(3)|浏览(124)

我在extjs中有一个Datefield,配置如下:

xtype: 'datefield',
            emptyText: 'mm/dd/yyyy',
            validateOnBlur: false,
            validateOnChange: false,
            width: ifNull(uiConfig.inputWidth, 120),
            hideTrigger: this.question.unknownField,
            maxValue: new Date(),
            listeners:{
                blur:{fn:this.onBlur, scope: this},
                focus: function() {
                    if(me.controls.dateUnknown)
                        me.controls.dateUnknown.setValue(false);

我想有这个dateField,但没有DatePicker在一边。

bhmjp9jg

bhmjp9jg1#

我发现下面的方法比文本字段定制方法简单得多:

{
 xtype: 'datefield',
 format: 'd-M-Y',
 hideTrigger: true,
 onDownArrow: Ext.emptyFn
}

(The“onDownArrow”覆盖用于在字段中按下向下箭头时阻止选择器出现)

3b6akqbq

3b6akqbq2#

hideTrigger:true用于隐藏选择器并仅显示底层文本字段
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.Date-cfg-hideTrigger

xqk2d5yq

xqk2d5yq3#

在Ext JS 7.0.0中

{
 xtype: 'datefield',
 format: 'd-M-Y',

 readOnly: true
}

相关问题