Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Open Tree and open Link in new Frame at same time
martib
Junior Member

Posts: 3
Registered: 4/5/2007
Member Is Offline
posted on 4/5/2007 at 02:34 PM Reply With Quote
Open Tree and open Link in new Frame at same time


Hi!

I have Tree Menu PRO.

I want to have if somebody clicks on a MainFolder (Parent) the tree (Child) opens and the link of the MainFolder (Parent) opens (in a frame).

So for now i have
['MainFolder','http://www.link.com',{'tw':'left_frame',},
but the comment for opening the tree is missing.

ow to get that?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 4/5/2007 at 08:00 PM Reply With Quote

what you have now will load the frame, but it will not open the node.
If you use PRO version of the script you can use the event system and API to change that. Hook the function to "select" event. In that function call .open() method of the node and then return true to allow the default handler.
View User's Profile View All Posts By User U2U Member
martib
Junior Member

Posts: 3
Registered: 4/5/2007
Member Is Offline
posted on 4/5/2007 at 08:59 PM Reply With Quote

sorry, but how do i hook the function to "select" event?
and how to call .open() method of the node?

is there a similar code or example somewhere?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 4/5/2007 at 11:15 PM Reply With Quote

There is this sample in the tree documentation:
Code:
/*
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
*/

function onItemSelectHandler (o_item) {
// if node with no link then toggle
var o_state = o_item.state();
if (o_state['node'] && !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;
}


it should be modified to meet your requirements:

Code:
function onItemSelectHandler (o_item) {
var o_state = o_item.state();
if (o_state['node'])
o_item.open()
// proceed to default handler
return true;
}


in tree_tpl.js you add following to the configuration structure:

'onItemSelect':'onItemSelectHandler'

again, this will work only with PRO version of the script
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Tree Menu
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   
Tigra Tree Menu PRO
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004