Treemenu Width Problem?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Boris
Advanced
Advanced
Posts: 10
Joined: Tue Jan 23, 2007 3:21 pm

Treemenu Width Problem?

Post by Boris »

Hello folks,

I'm having a slight problem with the menuwidth and itemwidth with a tree control. For example, if one were to download the tree example avalable here: http://milonic.com/treemenu/tree/, remove the style tags (they seem to override item/menu width's) and set the width, you'll notice that as each sub-menu (child) shows up relative to its parent it'll create its own subarea (div?) which doesn't comply with the menu width. The problem seems to be that when a child doesn't recalculat to be the width of the parent minus the horizontal offset.

Is this an option that I may have missed, or is this truly a problem? Please let me know if my explanation made no sense so that I can create a sample application for you.

On a side node, is the treemenu module "production ready?" I wasn't 100% sure based on the description below:
The TreeMenu.js module is currently at version 1.24 and getting better all the time. This latest release is almost workable. Still lots to do on the Tree Menu but the collapsible is almost there.

I've also tried a basic menu on one of our Apples (Safari) and had no problems visually or with the code.

Thank you,

Boris
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Hi,

Note that the current version of the tree is 1.26, available here. Please make sure you're running that and the current version (5.769) of the menu code.
John
Boris
Advanced
Advanced
Posts: 10
Joined: Tue Jan 23, 2007 3:21 pm

Post by Boris »

John wrote:Hi,

Note that the current version of the tree is 1.26, available here. Please make sure you're running that and the current version (5.769) of the menu code.
Thanks for the reply, John. I changed the JS file (and as far as I know I'm using the latest menu code), and the problem is still there.

Since a picture is worth a thousand words, I put a border around two child menus to illustrate what I meant in my original post:

Image

Thank you,

Boris
Boris
Advanced
Advanced
Posts: 10
Joined: Tue Jan 23, 2007 3:21 pm

Post by Boris »

Quick update...

I was able to create a workaround by making a copy of the main style and just removing the offset from each root node. I'm not extatic about this solution.

Code: Select all

child1Style=new copyOf(treeStyle);
child1Style.itemwidth = treeStyle.itemwidth - treeOffset;
child2Style=...
I'm curious, though, whether instead of setting an itemwidth it's possible to just set the menuwidth at the root node level and make sure that all nodes itemwidth's are adjusted to fit into the menuwidth.

Again, I'm sorry if this feature already exists, but if it doesn't, it certainly would be nice.

I'll still monitor this thread in case a cleaner solution is offered by somebody.

Thank you,

Boris
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi Boris,

I suppose we could add something to the code to ensure that the menus do not get too wide. Not sure how this will work for lots of levels though.

I'll look into it and see what we can do.

The technique you have used looks good though and should be OK

Cheers,
Andy
Post Reply