Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 1/11/2005 at 02:09 PM |
|
|
Easier expanding and collapsing?
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
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/12/2005 at 09:15 AM |
|
|
Please visit the product documentation page section API usage examples sample: Node open on single click.
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 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
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/12/2005 at 02:27 PM |
|
|
There is an event handler definition in the demo4 of your download package.
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 1/13/2005 at 07:33 AM |
|
|
Thx.
I'm gonna have a look inside.
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 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
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/13/2005 at 10:32 AM |
|
|
Find within demo4/tree_tpl.js var TREE2_TPL and function onItemOpenHandler
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 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
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 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
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 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]) {
o_item.o_root.toggle(o_item.n_id);
// 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
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/13/2005 at 12:28 PM |
|
|
this functionality should work.
try to call alert inside the handler function to find the breakpoint.
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 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);
</script>
I get an error "object expected" in the status bar of the browser.
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 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
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/13/2005 at 12:50 PM |
|
|
items.asp:
"<%=clink%>"
instead of
"javascript:linkCheck('<%=clink%>')"
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 1/13/2005 at 12:59 PM |
|
|
| Quote: | Originally posted by rock
items.asp:
"<%=clink%>"
instead of
"javascript:linkCheck('<%=clink%>')" |
Thx I got that :)
By the way thx for your great support.
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/13/2005 at 01:22 PM |
|
|
Try to define apropriate style in tree.css:
/*style for mouseovered item link*/
.mover{
....
}
.mover a{
width: 100%;
}
Assume 'mover' is class you've assigned to the items at mouseovered states.
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 1/13/2005 at 02:32 PM |
|
|
It works with
.mover a {
width: 100%;
display:block;
}
;)
|
|
|
uthi
Newbie
Posts: 1
Registered: 3/2/2005
Member Is Offline
|
| posted on 3/2/2005 at 03:59 PM |
|
|
Hi,
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.
Regards,
Ulrich Thiele, Alzenau, Germany
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 3/2/2005 at 04:14 PM |
|
|
Please refer to our Customer Care System
|
|
|