PDA

View Full Version : Auto menu dropdown on hover?



dbassett74
24 Jun 2009, 7:14 AM
In regular desktop applications, it is standard functionality for a toolbar item with a drop down menu to automatically appears if you first drop down one item, and then you move your mouse over other toolbar items. It does not seem to work this way with ExtJs. Is this something that I can easily implement? It is much more intuitive for the end user to be able to just move the mouse over the toolbar items and have them drop down, instead of having to click each one.

evant
24 Jun 2009, 7:49 AM
There's a trackMenus option for the toolbar that does this, though it doesn't seem to be documented as of yet.

dbassett74
24 Jun 2009, 8:01 AM
I tried it but doesn't seem to work. Is this in 3.0 RC1 or 2? I think I'm only running RC1 at this point.

evant
24 Jun 2009, 8:02 AM
Fairly sure was fixed in RC2 or later.

dbassett74
25 Jun 2009, 6:37 AM
Nope, just installed RC2 and still doesn't seem to work.

Condor
25 Jun 2009, 6:53 AM
That's not what trackMenus does. trackMenus only automatically opens menus from other buttons on the toolbar on mouseover once a menu is visible.

You could change that by using:

Ext.override(Ext.Toolbar, {
onButtonTriggerOver : function(btn){
if(!this.activeMenuBtn || this.activeMenuBtn != btn){
if(this.activeMenuBtn){
this.activeMenuBtn.hideMenu();
}
btn.showMenu();
this.activeMenuBtn = btn;
}
}
});

but you definately want to create some auto menu hide feature in that case.

dbassett74
25 Jun 2009, 7:32 AM
That's not what trackMenus does. trackMenus only automatically opens menus from other buttons on the toolbar on mouseover once a menu is visible.


That's what I'm trying to accomplish. I have three buttons on a toolbar, each of which has a menu. I click the first button which displays the menu for that button. Without clicking anything, I hover over to the next button the toolbar. Even with trackMenus=true, nothing happens. So what does trackMenus actually do?

makana
25 Jun 2009, 8:24 AM
The trackMenus option of the Toolbar(!) is exactly what you need. That's true by default. So what you want, is normal behavior without setting any option. All my toolbars work like this without setting anything to true, so I wonder a bit about your question. Maybe you should give us some code of your Toolbar.