-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Girish
Message 1 in Discussion

I have static Treeview control which is basically about country and states list.
In the treeview i am checking the nodes from the code behind if the values exits in 
the database.
This is working fine and i have all the parent and child nodes checked. I have written 
a javascript code to CHECk - UNCHECK all the Child nodes if parent node is UNCHECKED 
or checked.
The problem i am facing is the Javascript(alert(bChecked )) does not recognise the 
node as CHECKED or UNCHECKED if the node has been CHECKED from CODE BEHIND
If the node is not CHECKED from code behind, the javascript function is able to 
recognise the node as checked or unchecked
in page load i have added the below code TreeGeos.Attributes.Add("oncheck", 
"TreeClicked(this);")
<script language="javascript">
function TreeClicked(oTree)
{
 DirtyTrue();
 // Get the node that fired the event...
 var bChecked;
 var oNodeClicked = oTree.getTreeNode(oTree.clickedNodeIndex);
 var bChecked = oNodeClicked.getAttribute("checked");
                alert(bChecked )
 var oColl = oNodeClicked.getChildren();
 TraverseChildren(oColl, bChecked);
}
function TraverseChildren(oColl, bChecked)
{
 var oChild;
 for (var i=0;i<oColl.length;i++)
 { 
  oChild = oColl[i];
  oChild.setAttribute("checked", bChecked);
 }
}
</script> Please let me know how to fix this problem. The javascript code is 
transversing the whole Treeview control, and this i use for the requiredfield 
validator, to ensure atleast one node is checked. i have some code for that.
But the main prob is the javascript does   not recognize the node check uncheck if the 
node already has attribute checked, which was set from code behind <tvns:treenode 
Checked="true" CheckBox="True" ID="265">
     Alaska
    </tvns:treenode>
 Thanks Girish

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to