-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have a menu popup on the bottom left of my page. This menupopup has its own menupopup.
The problem is that when I open the menu and open one of its children the children appears over the parent and I can't select another item.
Here's a simple example:
<zk> <window border="normal" title="hello" height="100%" apply="pkg$.TestComposer"> <borderlayout> <center> </center> <south> <menubar autodrop="true"> <menu label="Opciones"> <menupopup> <menu label="Empresa"> <menupopup> <menuitem label="Emp 1" /> <menuitem label="Emp 2" /> </menupopup> </menu> <menu label="Idioma"> <menupopup> <menuitem label="ES"/> <menuitem label="CA"/> </menupopup> </menu> </menupopup> </menu> </menubar> </south> </borderlayout> </window> </zk>
Here you have an image:
It's been happening since yesterday when I update to the new freshly build. I'm using ZK 6.0.3.
Have a look at adding the "position" information. OK, I've not used it with MenuPopup but have used it with Tootip like below :-
zz.setTooltip(popup_id + ", position=start_after, delay=500")
See also http://www.zkoss.org/zkdemo/popup/popup_position
I hope at least it points you in the right direction.
First of all, I tried the code above and it worked OK (not pretty, but worked) on ZK6.5. First drop down overlayes "Opciones", second drop down is at the right of the first.
However try the following :
<zk> <window border="normal" title="hello" height="100%" apply="pkg$.TestComposer"> <borderlayout> <center> </center> <south> <menubar autodrop="false"> <menu label="Opciones" onClick='frog.open(100,100);'> <menupopup id="frog"> <menu label="Empresa"> <menupopup> <menuitem label="Emp 1" /> <menuitem label="Emp 2" /> </menupopup> </menu> <menu label="Idioma"> <menupopup> <menuitem label="ES"/> <menuitem label="CA"/> </menupopup> </menu> </menupopup> </menu> </menubar> </south> </borderlayout> </window> </zk>
You need to click on "Opciones" now to get the menu to open.
You can also use onClick='frog.open(self,"end_before");'
This just gives you an idea. You need to do other work as the click of the "drop-down" button needs trapping (the onClick is on the label, not the drop-down button).
Just hope it points you in the right area.
Bobzk.
Asked: 2012-10-25 07:42:01 +0800
Seen: 123 times
Last updated: Nov 06 '12