Results 1 to 2 of 2

Thread: XML, ASP Tree

  1. #1
    Join Date
    Dec 1969

    Default XML, ASP Tree

    I saw the nicely prepared article on XML, javascript, ASP to build a tree just like an explorer tree. http://www.4guysfromrolla.com/webtech/072501-1.shtml is the link.<BR><BR>But in my application, i need to highlight the selected folder. But as i looked into the code, there&#039;s only a href link and no other ids to identify that particular selected folder. Does anyone got some idea to highlight the selected folder?<BR><BR>What i actually need is something like the real windows explorer which will show the selected folder as open and all the other folders as closed. But some may be expanded and some may not.<BR><BR>If anybody got suggestions please reply..

  2. #2
    Join Date
    Dec 1969

    Default This ought to get you started

    My implementation sometimes has multiple nodes selected (code not included here). You may not have that. But this should give you a place to start from.<BR><BR><BR>UnSelectTreeNodes() <BR> { <BR> var oCtrl; <BR> var sCtrl=&#039;&#039;; <BR> var sCtrlTmp=&#039;&#039;;<BR> for (oCtrl in document.all.tags(&#039;A&#039;))<BR> { <BR> sCtrl = new String(oCtrl);<BR> sCtrlTmp = &#039;&#124&#039; + sCtrl; <BR> if (sCtrlTmp.indexOf(&#039;Tree_&#039;) &#062; 0) <BR> { <BR> document.getElementById(sCtrl).style.color = &#039;#FFFFFF&#039;; <BR> document.getElementById(sCtrl).style.backgroundCol or=&#039;#507FC7&#039;; <BR> } <BR> } <BR> } <BR> function SelectTreeNode(sID) <BR> { <BR> UnSelectTreeNodes(); <BR> document.getElementById(sID).style.color = &#039;#507FC7&#039;; <BR> document.getElementById(sID).style.backgroundColor =&#039;FFFFFF&#039;; <BR> }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts