G
Graeme Coutts
I have a IE Treeview and I am trapping the onselectedindexchange event in a
JavaScript function by:
tree.Attributes.Add("onselectedindexchange",tree.ClientID+"_onchange();");
The JavaScript function simply reads the text of the new selected node and
then writes this to a text field. It looks like:
function tree_tree_onchange()
{
var tree;
var treenode;
tree=document.getElementById('tree_tree');
treenode=tree.getTreeNode(tree.selectedNodeIndex);
document.all.item('tree_text').value=treenode.getAttribute('Text');
}
Everything is working great except when I re-post the form to the server
(using a separate button control) the selectednodeindex that was set on the
client-side is lost. The tree conttrol returns to the default (first node) as
the selected node.
anyone got a solution for this so that I can retain the client-side
selection?
JavaScript function by:
tree.Attributes.Add("onselectedindexchange",tree.ClientID+"_onchange();");
The JavaScript function simply reads the text of the new selected node and
then writes this to a text field. It looks like:
function tree_tree_onchange()
{
var tree;
var treenode;
tree=document.getElementById('tree_tree');
treenode=tree.getTreeNode(tree.selectedNodeIndex);
document.all.item('tree_text').value=treenode.getAttribute('Text');
}
Everything is working great except when I re-post the form to the server
(using a separate button control) the selectednodeindex that was set on the
client-side is lost. The tree conttrol returns to the default (first node) as
the selected node.
anyone got a solution for this so that I can retain the client-side
selection?