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: Trying to select a node through a customized function
pandit_akshay
Newbie

Posts: 1
Registered: 11/12/2003
Member Is Offline
posted on 11/12/2003 at 01:47 PM Reply With Quote
Trying to select a node through a customized function


hi to all,

I've a customized function which is attached through which I'm trying to select a particular node (folder), not able to do it due to an error which say's Node is undefined code for the error is :

var node = trees[0].o_root.ref_index[ref_id];

as soon as I do this I get an error node is undefined. but value's are coming perfectly correct and they exist in jsp file also.. can any body please help me as aI'm not good at javascript and needs help....

waiting eagerly for reply..

truly..
Akshay Pandit

Attachment: customized_script_for_selecting_node.txt (405b)
This file has been downloaded 709 times
View User's Profile View All Posts By User U2U Member
dward
Junior Member

Posts: 4
Registered: 11/11/2003
Member Is Offline
posted on 11/12/2003 at 11:18 PM Reply With Quote

Hello Akshay,

From looking at your code, it looks like you are trying to select a node by it's id. If so, this will do the trick. Most of it was taken from SoftComplex's example at

http://www.softcomplex.com/products/tigra_tree_menu_pro/docs/#api_examples
Code:


function selectItemById(id) {

var o_tree = (TREES[0]),
o_item = o_tree.o_root.a_index[id],
n_id = o_item.n_id,
n_depth = o_item.n_depth,
a_index = o_item.o_root.a_index,
a_parents = [o_item];

while (n_depth) {
if (a_index[n_id].n_depth < n_depth) {
a_parents[a_parents.length] = a_index[n_id];
n_depth--;
}
n_id--;
}

for (var i = a_parents.length-1; i >= 0; i--)
if (a_parents.n_state & 48)
a_parents.open();

o_item.select();
}

It does not include any error checking and will fail if the specified node id does not exist. It is also only good for the first tree on the page. That is all easily fixed though.


Enjoy,
Dan
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