Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:43

Treemenu Width Problem?


Poster: Boris
Dated: Tuesday January 23 2007 - 14:44:28 GMT

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://www.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


Poster: John
Dated: Tuesday January 23 2007 - 15:12:31 GMT

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.


Poster: Boris
Dated: Tuesday January 23 2007 - 15:33:03 GMT

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


Poster: Boris
Dated: Tuesday January 23 2007 - 21:07:32 GMT

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:
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


Poster: Andy
Dated: Tuesday January 23 2007 - 21:45:27 GMT

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