TreeView1_ImageArray images positions are not fix

A

Alex D.

Hi. I am trying to dynamically change the nodes pictures in javascript in my
treeview and with patience I visited all the urls in my ImageArray to see
what picture was. Then I used the same url to get to that picture but it was
a different picture!! I know those pictures are created dynamically by
asp.net but I thought the positions in the array were always the same
because the TreeView_ToggleNode(...) function uses fixed positions in its
code (see below). Am I doing something wrong?? Thanks. alex.

function TreeView_ToggleNode(data, index, node, lineType, children) {
var img = node.childNodes[0];
var newExpandState = "e";
if (children.style.display == "none") {
children.style.display = "block";
if (img != null) {
if (lineType == "l") {
img.src = data.images[15];
}
else if (lineType == "t") {
img.src = data.images[12];
}
else if (lineType == "-") {
img.src = data.images[18];
}
else {
img.src = data.images[5];
}
img.alt = data.collapseToolTip.replace(/\{0\}/,
TreeView_GetNodeText(node));
}
}
else {
newExpandState = "c";
children.style.display = "none";
if (img != null) {
if (lineType == "l") {
img.src = data.images[14];
}
else if (lineType == "t") {
img.src = data.images[11];
}
else if (lineType == "-") {
img.src = data.images[17];
}
else {
img.src = data.images[4];
}
img.alt = data.expandToolTip.replace(/\{0\}/,
TreeView_GetNodeText(node));
}
}
data.expandState.value = data.expandState.value.substring(0, index) +
newExpandState + data.expandState.value.slice(index + 1);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top