我想創建一個表單來爲Ext js 4中的搜索查詢提供可選參數。 我已經通過使用menuitem實現了此目的。它工作正常,但它有我需要擺脫的奇怪的行爲:如何在Extjs 4中創建包含表單的下拉菜單
在鼠標懸停在文本框,這是菜單項,它獲得焦點,無需等待點擊,它失去了重點放在鼠標。這意味着,如果我想鍵入某個東西,我應該將其懸停,如果將鼠標移動到其他位置,則會失去焦點,直到我將鼠標移回時才能繼續打字。這對於菜單項來說實際上是正確的,因爲它應該是按鈕。
{
xtype: 'button',
action: 'chooseOptions',
text: 'Options',
menu: new Ext.menu.Menu({
plain: true,
allowOtherMenus: true,
items: [
{
xtype: 'textfield',
name: 'login',
fieldLabel: 'Login',
labelWidth: 100,
margin: '10 10 10 10',
width: 300
},
{
xtype: 'combobox',
fieldLabel: 'Type',
name: 'type_id',
store: 'MyStore',
displayField: 'value',
valueField: 'id',
editable: false,
labelWidth: 100,
margin: '0 10 10 10',
width: 300
},
{
xtype: 'combobox',
fieldLabel: 'Agent',
name: 'a_id',
store: 'Agents',
displayField: 'name',
valueField: 'id',
editable: false,
labelWidth: 100,
margin: '0 10 10 10',
width: 300
}
]
})
},
有沒有其他方法可以實現呢?
這沒有奏效。我需要的是禁用鼠標懸停事件中的菜單項。他們應該只關注點擊。 – Jamol
然後,你可以通過https://fiddle.sencha.com/創建一個Extjs小提琴嗎? –