gpt4 book ai didi

选择月份或年份时,ExtJS 5 xtype日期字段不起作用

转载 作者:行者123 更新时间:2023-12-04 04:25:29 24 4
gpt4 key购买 nike

单击下拉菜单选择单个月/年时,该对话框消失,就像我试图单击时一样。

fiddle :https://fiddle.sencha.com/#fiddle/9m6

   Ext.onReady(function() {
Ext.create('Ext.form.Panel', {
title: 'Simple Form',
bodyPadding: 5,
width: 350,
// The fields
defaultType: 'textfield',
items: [{
xtype: 'datefield',
fieldLabel: 'Start Date',
id: 'startDate'
}],
renderTo: Ext.getBody()
});
});

这已在ExtJs 5.1.0.107中修复。

EXTJS-15968 Date Picker disappear after click on Month Picker.

http://docs.sencha.com/extjs/5.1/whats_new/release_notes.html

最佳答案

事实证明,这确实是Ext.Js 5.0.1中的错误。
http://www.sencha.com/forum/showthread.php?289825

覆盖Ext.picker.Date类的解决方案为我工作:

Ext.define('EXTJS-14607.picker.Date', {
override: 'Ext.picker.Date',


runAnimation: function(isHide) {
var me = this,
picker = this.monthPicker,
options = {
duration: 200,
callback: function() {
picker.setVisible(!isHide);
// See showMonthPicker
picker.ownerCmp = isHide ? null : me;
}
};


if (isHide) {
picker.el.slideOut('t', options);
} else {
picker.el.slideIn('t', options);
}
},


hideMonthPicker: function(animate) {
var me = this,
picker = me.monthPicker;


if (picker && picker.isVisible()) {
if (me.shouldAnimate(animate)) {
me.runAnimation(true);
} else {
picker.hide();
// See showMonthPicker
picker.ownerCmp = null;
}
}
return me;
},


showMonthPicker: function(animate) {
var me = this,
el = me.el,
picker;


if (me.rendered && !me.disabled) {
picker = me.createMonthPicker();
if (!picker.isVisible()) {
picker.setValue(me.getActive());
picker.setSize(el.getSize());
picker.setPosition(-el.getBorderWidth('l'), -el.getBorderWidth('t'));
if (me.shouldAnimate(animate)) {
me.runAnimation(false);
} else {
picker.show();
// We need to set the ownerCmp so that owns() can correctly
// match up the component hierarchy, however when positioning the picker
// we don't want it to position like a normal floater because we render it to
// month picker element itself.
picker.ownerCmp = me;
}
}
}
return me;
}
});

关于选择月份或年份时,ExtJS 5 xtype日期字段不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25979828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com