Board Logo

Easier expanding and collapsing?
Bender - 1/11/2005 at 02:09 PM

My first database driven tree menu works more or less fine.

But I'd like to expand and collaps the tree by clicking on the selected "line" instead of the plus/minus buttons. Is that possible?

rock - 1/12/2005 at 09:15 AM

Please visit the product documentation page section API usage examples sample: Node open on single click.

Bender - 1/12/2005 at 11:38 AM

I saw it. And how do I implement and call these functions? Are there any samples around?

rock - 1/12/2005 at 02:27 PM

There is an event handler definition in the demo4 of your download package.

Bender - 1/13/2005 at 07:33 AM


I'm gonna have a look inside.

Bender - 1/13/2005 at 10:22 AM

Isn't it demo5? There I can doubleclick right to the link and the tree expands/collapses.

But I can't find the function in order to implement it into tree_tpl.js.

Where is it?

rock - 1/13/2005 at 10:32 AM

Find within demo4/tree_tpl.js var TREE2_TPL and function onItemOpenHandler

Bender - 1/13/2005 at 11:22 AM

the function you mentioned is doing something else than I want it to: I allows only one subtree to be open.

But I'd like to be able to have all subtree opened. AND I'd like to expand/collapse the trees by clicking into the selected area of the menu entry. As in demo5.

rock - 1/13/2005 at 11:27 AM

As you can see you've define onItemOpen handler function (which fires when open the node), and you need onItemSelect handler function, mentioned in the documentation.

Node open on single click:
This function modifies tree behavior so nodes without link
assigned will open on single click
Function should be called AS onItemSelect handler of the tree

Bender - 1/13/2005 at 12:07 PM

O.k. I changed to:

// event handlers - item
'onItemSelect':'onItemSelectHandler' // on item open event handler
// make sure there is no comma after the last key-value pair

function onItemSelectHandler (o_item) {
// if node with no link then toggle
if (o_item.a_config[3] && !o_item.a_config[1]) {
// cancel default action
return false;
// proceed to default handler
return true;

And I do not have any links in the database link field. But it still doesn't work. Has this anything to do with the link check function?

rock - 1/13/2005 at 12:28 PM

this functionality should work.
try to call alert inside the handler function to find the breakpoint.

Bender - 1/13/2005 at 12:42 PM

How do I get rid of this function linkCheck(s_user) ?

I think this is causing the problem.

If I call the tree simply with

<script language="JavaScript">
new tree (TREE_ITEMS, TREE_TPL);

I get an error "object expected" in the status bar of the browser.

Bender - 1/13/2005 at 12:49 PM

I found it.

O.k. now the subtree collapses/expands whe I click on the text link (instead of going to the link)

That's almost that what I wanted. I want to collaps/expand the trees by clicking next to the text (inside the selected row). Is that not possible?

rock - 1/13/2005 at 12:50 PM

instead of

Bender - 1/13/2005 at 12:59 PM

Originally posted by rock
instead of

Thx I got that :)

By the way thx for your great support.

rock - 1/13/2005 at 01:22 PM

Try to define apropriate style in tree.css:
/*style for mouseovered item link*/

.mover a{
width: 100%;

Assume 'mover' is class you've assigned to the items at mouseovered states.

Bender - 1/13/2005 at 02:32 PM

It works with

.mover a {
width: 100%;


uthi - 3/2/2005 at 03:59 PM


I am using Mindmanager/Mindjet to create websites for a customer. The application uses obviously a license by SoftComplex to establish the navigation tree. Example:
(URL is extracted by admin, please don't publish script files of commercial products, border rule #5)

There is the problem, that customers complain about the expanding and collapseing the tree by clicking on the selected "line" instead of the plus/minus buttons, as described in this topic.

However I am not an expert in Java and would like to ask somebody here or at SoftComplex to do the modifying of the scripts for us; of course we would pay for this service.

I appreciate your help.


Ulrich Thiele, Alzenau, Germany

rock - 3/2/2005 at 04:14 PM

Please refer to our Customer Care System

Back to forum: