我已經創建了帶有選項的拆分按鈕。我需要點擊按鈕旁邊顯示的選項的值。我嘗試了我編寫的以下代碼,但它不顯示該選項。建議將不勝感激。顯示拆分按鈕選項
Ext.create('Ext.button.Split', {
renderTo: Ext.getBody(),
text: 'Options',
handler: function() {
alert("The button was clicked");
},
menu: new Ext.menu.Menu({
items: [
{text: 'Item 1', handler: function({
Ext.create('Ext.form.field.Display', {
value: 'Item 1'}
)}
},
{text: 'Item 2', handler: function(){ {
Ext.create('Ext.form.field.Display', {
value: 'Item 2'}
)}
}
]
})
});
您並未在任何地方渲染該字段。 –