Ext.onReady(function(){
Ext.create("Ext.Viewport", {
layout: "fit",
items: {
xtype: "panel", title: "My Panel",
bbar: {
xtype: "toolbar", id: "mybbar",
items: [{
id: "myBtn", text: "button 1",
//menuAlign: 'tl', ... doesn't work
menu: {
title: "MENU",
//buttonAlign: "left", ... doesn't work
//defaultAlign: "myBtn", ... doesn't work
items: [{text: "option 1"}, {text: "option 2"}, {text: "option 3"}]
}
}, {text: "button 2"}]
},
html: "content"
}
});
})
The only way to solve this problem I have found is to add a listener to the button with the following code:
{
id: "myBtn", text: "button 1",
menu: {
title: "MENU",
items: [{text: "option 1"}, {text: "option 2"}, {text: "option 3"}]
},
listeners: {
menushow: function(oBtn, oMenu){
oMenu.alignTo(oBtn);
}
}
}
Force the alignment to the button when the menu is displayed.
No comments:
Post a Comment