| Author |
Message |
dphoto
Joined: 25 Jun 2006 Posts: 4 Location: Scotland
|
Posted: Thu Jul 13, 2006 11:31 pm Post subject: Initialising cooltreepro |
|
|
Hi,
Try as I might I cannot get this to work.
I have cooltree initialised and working properly but want to upgrade to Pro. I have two trees on the same page.
Here is my page code | Code: | </tbody>
</table>
<!-- OUTER TABLE-->
<script type="text/javascript">
var MyTree = new COOLjsTree("tree1", TREE_NODES, TREE_FORMAT);
var Mytree = new COOLjsTree("tree2", TREE_NODES_SUBJECT, TREE_SUBJECT_FORMAT);
</script>
<script type="text/javascript">myTree.init()</script>...
...
<script type="text/javascript">RedrawAllTrees()</script>
</body>
</html> |
If I swap cooltree.js for cooltreepro.js the tree fails.
Where have I gone wrong?
Thanks
Dave |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
|
| Back to top |
|
 |
dphoto
Joined: 25 Jun 2006 Posts: 4 Location: Scotland
|
Posted: Wed Aug 16, 2006 11:30 am Post subject: |
|
|
Hi Alex,
I've finally sorted this. My problem was to do with the fact that I am using two trees on the same page.
My code is now | Code: | var MyTree = new COOLjsTreePRO("tree1", TREE_NODES, TREE_FORMAT);
</script>
...
<script type="text/javascript">MyTree.init()
</script>
...
<script type="text/javascript">RedrawAllTrees()
</script>
<script type="text/javascript">
var MyTree = new COOLjsTreePRO("tree2", TREE_NODES_SUBJECT, TREE_SUBJECT_FORMAT);
</script>
...
<script type="text/javascript">MyTree.init()
</script>
...
<script type="text/javascript">RedrawAllTrees()
</script> |
Perhaps you could make the initialisation sequence clearer for two or more trees on the same page. It would be good for dunces like me anyway
Cheers
Dave |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Wed Aug 16, 2006 3:31 pm Post subject: |
|
|
That's why we have samples with two or more trees on the same page. Also, docs clearly say:
| Quote: | | "tree1" - name of the tree; if you have several trees on the page then you have to name them differently, e.g. "tree1", "tree2" and so on; it is recommended to compose these names using alphanumeric characters because there are many places where names will be used: CSS class names, images' and layers' identifiers - some browsers do not allow to have fancy symbols here (e.g. Opera 5 does not understand CSS class names with underscores); |
|
|
| Back to top |
|
 |
|