View Full Version : Drop Down Navigation
gtg489w
14 Jan 2009, 2:33 PM
I'm trying to put together a site with GXT that calls for the use of drop down navigation. The problem I'm having is that a LayoutContainer will hide anything that exceeds its bounds. I've been using a LayoutContainer with AbsoluteLayout... sample code
LayoutContainer container = new LayoutContainer();
container.setWidth(500);
container.setHeight(30);
container.setLayout(new AbsoluteLayout());
Label hello = new Label("Hello");
container.add(hello, new AbsoluteData());
Viewport vp = new Viewport()
vp.add(container);
RootPanel.get().add(vp);
Any ideas or alternative suggestions would really be appreciated, thanks
-Brian
kolli
14 Jan 2009, 7:54 PM
Can you be more clear in your question??
gtg489w
15 Jan 2009, 12:18 AM
I'm looking to produce a similar navigation to ExtJS's site. If you hover over the Products link you'll get a context menu. The code I posted previously shows a label that is cut off because the layoutcontainer's height is explicitly set and the absolutely positioned widget will not appear in front of the remaining content.
I've tried fixing this by setting the z-index of the label but I've had no success.
gslender
15 Jan 2009, 5:06 AM
child widgets don't resize their parent's containers.
gtg489w
15 Jan 2009, 8:11 AM
That's obvious if you look at the code I posted. What I'm getting at is I want the content to be placed on top of all other existing content, not resizing content, not bleeding through, but to overlay the absolutely positioned label
kolli
15 Jan 2009, 11:04 AM
how does your code explain anything about placing the content on the top. Can you provide some meaningful code related to your question?
gtg489w
15 Jan 2009, 12:13 PM
Hopefully this will be a little more clear. I want the entire black menu to be displayed
LayoutContainer container = new LayoutContainer();
container.setWidth(500);
container.setHeight(30);
container.setStyleAttribute("background","#abcdef");
contaner.setLayout(new AbsoluteLayout());
LayoutContainer menu = new LayoutContainer();
menu.setHeight(400);
menu.setWidth(200);
menu.setStyleAttribute("background","#000000");
container.add(menu, new AbsoluteData(20,20));
gslender
15 Jan 2009, 1:06 PM
you are adding the menu as a child of container - if you want it to be unconstrained by container then it needs to added to the parent above (rootpanel?).
gtg489w
15 Jan 2009, 1:09 PM
That would work but I would like the positioning to be offset relative to container
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.