3.0 beta 2

Tree Widget nodes expanded but icons not lined up

I am using the following javascript code in a loop to expand a few nodes in the Tree Widget:

espTree.setViewExpanded(true,#nodeNum#);

When the tree is rendered the nodes are expanded, but the +/- icons (displayed for the user to expand/contract the nodes) are not indented properly. They are all displayed along the lefthand side of the screen. However as I move the mouse over the tree widget, the +/- icons "jump" to their correct location.

Does anyone know how to fix this?
Carolyn
November 7,
Could you post an example so I can reproduce this?
Alex (ActiveWidgets)
November 8,
Here is some HTML code that duplicates my problem.
My original source is CFM and the Tree Widget is built from data in a database, which which is why there is a message "retrieving data from database...".
I am creating a table with the Tree Widget in one cell and other text, etc. in the rest of the table.


ESP Tree Lookup<br />
<hr/>
<table border="0">
<tr>
<td>
<div id="treeWidget" style="width:450px;height:380px;">Retrieving Data from Database....</div>
</td>
</tr>
</table>
<!-- include AW library files -->
<script type='text/javascript' language="javascript" src="/activewidgets/runtime/lib/aw.js"></script>
<script type="text/javascript" language="javascript">
var treeText = new Array();
var treeImage = new Array();
var treeView = new Object();
treeImage[0] = "";
treeText = ["", "Top Level", "Level 1", "Level 2", "Level 3", "Level 4", "Level 1A", "Level 1B", "Level 2A"];
treeImage = ["", "home", "favorites", "favorites", "favorites", "favorites", "search", "search", "search"];
treeView = {0:[1], 1:[2,3,4,5], 2:[6,7], 3:[8]};

var espTree = new AW.UI.Tree;
espTree.setSize(365,400);
espTree.setId("treeWidget");
espTree.setItemText(treeText);
espTree.setItemImage(treeImage);
espTree.setViewCount(function(i){return treeView[i] ? treeView[i].length : 0});
espTree.setViewIndices(function(i){return treeView[i]});

espTree.setViewExpanded(true,1);
espTree.setViewExpanded(true,2);
espTree.setItemSelected('selected',6);
espTree.refresh();
</script>
</body>
</html>
Carolyn
November 8,
I forgot to add that the problem occurs when using IE, not when using FireFox.
Carolyn
November 8,
Carolyn,

I cannot reproduce this problem with your code fragment. Do you see it on one particular machine or on several different ones? Which versions of AW and IE? Does it depend on something else on your page?
Alex (ActiveWidgets)
November 12,
Several different users are seeing the problem on several different machines. I haven't found anyone that it works successfully for.
IE version 6.0.2900.2180 sp2
AW version 2.0.2
I created the example code containing nothing but the one tree widget (and it fails for us) so I'm pretty sure nothing else on the original page is causing the problem.
Something to add... When I add document.write(espTree); at the end of the script, a 2nd tree is displayed at the bottom of the page and this 2nd tree displays correctly (all +/- icons are indented properly).
Carolyn
November 13,
I got this to work. In the above example I deleted all table tags, so the DIV tag containing the Tree Widget is no longer inside a table cell, and it fixed the problem.
Carolyn
November 15,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.