简体   繁体   English

如何清除时域选择?

[英]How do I clear the timefield selection?

                    {
                        xtype: 'timefield',
                        fieldLabel: Locale.gettext( 'End Time' ),
                        hidden: _self.hideEndTime,
                        editable: _self.editableEndTime,
                        listeners: {
                            change: function( t, newVal ) {
                                var btnCnt = t.previousSibling('fieldcontainer').query('button[pressed=true]');
                                if( btnCnt.length < 2 ) {
                                    t.previousSibling( 'timefield' ).setMaxValue( newVal );
                                } else {
                                    t.previousSibling( 'timefield' ).setMaxValue( '' );
                                }
                            }
                        }
                    }

If one item has been selected in the drop-down of 'tiemfield', the item will be highlight. 如果在“ tiemfield”的下拉菜单中选择了一项,则该项将突出显示。 I am trying to clear/reset this, but the reset only reset the text field, and the the item that I previously selected is still highlighted. 我正在尝试清除/重置,但“重置”仅重置文本字段,而我之前选择的项目仍突出显示。 Is there any why to reset the drop-down? 为什么要重置下拉菜单?

I was able to replicate the issue in 4.1 in the fiddle. 我能够在小提琴中用4.1复制这个问题。

A work around I was able to come up with is to refresh the timepicker after resetting. 我能想到的解决方法是在重置后refresh选择timepicker

myTimeField.getPicker().refresh()

And here is a working fiddle with the fix 这是修复工作的小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM