| Author |
Message |
bkdell11
Joined: 24 Apr 2005 Posts: 4
|
Posted: Sun Apr 24, 2005 11:04 pm Post subject: Two different tree nodes on the same page? |
|
|
I'm designing a page where I have 2 different trees. One will be on the left side and one on the right side of the page.
The left nav and right nav will have totally different links, but will share the same look and feel. Can this script support this? I've tried to call 2 different node files (I use .js files), but the script doesn't want to load either node.
Any ideas on how I can do this or if it is possible?
Thanks |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Tue Apr 26, 2005 8:47 am Post subject: |
|
|
Yes, tree supports this. You have to specify different names for each of these trees. Look at the following code:
| Code: | var tree1 = COOLjsTreePRO('myTree1', ...);
var tree2 = COOLjsTreePRO('myTree2', ...); |
|
|
| Back to top |
|
 |
bkdell11
Joined: 24 Apr 2005 Posts: 4
|
Posted: Wed Apr 27, 2005 10:04 pm Post subject: |
|
|
Thanks for the reply
Specifying just different tree names doesn't seem to solve the problem. Here's what I have loaded in the <head> part of the page
| Code: | <script language="JavaScript" src="navtree.js"></script>
<script language="JavaScript" src="otn_nodes.js"></script>
<script language="JavaScript" src="obe_master_nodes.js"></script>
<script language="JavaScript" src="ocom_format.js"></script>
<script language="JavaScript">
var treeName = "Tree1";
var treeName = "Tree2";
var tree1 = new COOLjsTreePRO (treeName, OTN_ALL_CLOSED_NODES, TREE_FORMAT);
var tree2 = new COOLjsTreePRO (treeName, OBE_AS10G_904_NODES, TREE_FORMAT);
</script> |
So I want otn_nodes to display on the left and obe_master_nodes to display on the right. So here's what I put in those 2 spots:
| Code: | <script language="JavaScript">
tree1.init();
</script>
<script language="JavaScript">
tree2.init();
</script>
|
When I do this, I get javascript error on line 351, char 4. 'this.el.style' is null or not an object. Which I think refers to navtree.js file
Neither node gets displayed. I feel I'm close to solving, but not quite there.
Thanks |
|
| Back to top |
|
 |
Victor_Chuiko Support Team
Joined: 12 Apr 2005 Posts: 145
|
Posted: Wed Apr 27, 2005 11:31 pm Post subject: |
|
|
You must have misprinted. You are trying to store two tree names in one variable.
| Code: | var treeName = "Tree1";
var treeName = "Tree2"; |
You just need to correct it like this:
| Code: | var treeName1 = "Tree1";
var treeName2 = "Tree2";
var tree1 = new COOLjsTreePRO (treeName1, OTN_ALL_CLOSED_NODES, TREE_FORMAT);
var tree2 = new COOLjsTreePRO (treeName2, OBE_AS10G_904_NODES, TREE_FORMAT); |
Also you might need to do the same with TREE_FORMAT, If there is a proble hust copy your TREE_FORMAT and name it something like TREE_FORMAT2. |
|
| Back to top |
|
 |
|