PDA

View Full Version : Button with menu - CLICK event



diablo
15 Feb 2012, 6:32 AM
Hello,

following case:



Ext.create('Ext.Button', {
text : 'Menu button',
renderTo : Ext.getBody(),
arrowAlign: 'bottom',
handler: function(){alert("clicked")},
menu : [
{text: 'Item 1'},
{text: 'Item 2'},
{text: 'Item 3'},
{text: 'Item 4'}
]
});


Wouldn't be nice that on button click the handler is triggered and on arrow trigger click the menu is displayed?
Why both on click?

Thanks & Rergards

mitchellsimoens
15 Feb 2012, 6:42 AM
It is possible you want separate actions when a button is clicked that when the arrow is clicked.

diablo
15 Feb 2012, 7:02 AM
It is possible you want separate actions when a button is clicked that when the arrow is clicked.

exactly, i want Action on button click and Menu on arrow click. Now when i click the button i get both.

mitchellsimoens
15 Feb 2012, 7:08 AM
There are two events that you can listen to... click and arrowclick

diablo
15 Feb 2012, 7:24 AM
doesn't work, Ext.button.Button doesn't trigger any arrowClick events.
found myself the solution , what i needed was the Ext.button.Split, where both click handlers trigger separately.
Even though. thanks for your quick responses.

LE: saw now that split triggers arrowClick event..:)