JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Automatically expand tree levels

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu
Author Message
guest
Guest





PostPosted: Wed Oct 01, 2003 3:28 am    Post subject: Automatically expand tree levels Reply with quote

Im just trying to get a couple of tree levels to automatically expand, but it doesnt seem to want to work... Whats the exact code to get the top level to be expanded automatically and where do I need to put it? How can I get all levels to expand?

<link href="cooltree.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="cooltree.js"></script>
<script language="JavaScript">
var TREE1_NODES = [
['&Home', 'main.html', "main",
['&Applications / Authorisations', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&General Information', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&Hardware', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&Helpdesk Shifts', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&Infra Active', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&Telephone Services', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&Appendices', null, null,
['SubItem 1', null, null],
['SubItem 2', null, null]
],
['&Email Responses', null, null,
['AutoText', null, null],
['Complaint Response', null, null],
['Photocopier Complaints', null, null]
]
]
];
</script>
<script language="JavaScript">
var TREE1_FORMAT =
[
//0. left position
2,
//1. top position
2,
//2. show +/- buttons
true,
//3. couple of button images (collapsed/expanded/blank)
['img/c3.gif', 'img/e3.gif', 'img/b.gif'],
//4. size of images (width, height,ident for nodes w/o children)
[16,16,0],
//5. show folder image
true,
//6. folder images (closed/opened/document)
["img/fc3.gif", "img/fe3.gif", "img/d3.gif"],
//7. size of images (width, height)
[16,16],
//8. identation for each level [0/*first level*/, 16/*second*/, 32/*third*/,...]
[0,6,22,38,50,68,96,112,128,144,160,176,192,208,224,240,256,272],
//9. tree background color ("" - transparent)
"",
//10. default style for all nodes
"clsNode",
//11. styles for each level of menu (default style will be used for undefined levels)
[],
//12. true if only one branch can be opened at same time
false,
//13. item pagging and spacing
[0,0],
];
</SCRIPT>

</head>


<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>

<script language="JavaScript">
var treeName = "Tree1";
new COOLjsTree (treeName, TREE1_NODES, TREE1_FORMAT);
Tree1.expandAll(true);
</script>
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Oct 08, 2003 6:09 pm    Post subject: Reply with quote

Correct code is:
Code:

var treeName = "Tree1";
var tree = new COOLjsTree (treeName, TREE1_NODES, TREE1_FORMAT);
tree.expandAll(true);
</script>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu All times are GMT
Page 1 of 1