Writing Data to Tree Structure

Results 1 to 2 of 2

Thread: Writing Data to Tree Structure

  1. #1
    Join Date
    Dec 1969

    Default Writing Data to Tree Structure

    I have created a tree structure using JavaScript, and I am using ASP to write the data from an Access database into the folders. At the top level I have 4 "Domains", then the second level I have 34 "Processes" then at the third level I have 245 "Components" I have hard coded the code to create the 4 Domain folders, and I am not having a problem writing out the 34 Process folders, but I am having a problem writing out the correct files under the 34 Process folders. I can get the code to write out all 245 Component files under each Process Folder, but I only want the files that correspond to the Process folder to be written out under the folder. Here is my code:<BR><BR>&#060;ul id="foldinglist" style="display:none" style=&{head};&#062;<BR> &#060;!-- #include virtual="/VBD/Includes/DataConnection.asp" --&#062;<BR>&#060;%<BR> rstRS1.MoveFirst<BR> Do while not rstRS1.eof<BR> If rstRS1("Pro_DC") = 1 Then<BR> strOutput = "&#060;li id=&#039;foldheader&#039;&#062;" & rstRS1("Pro_Name") & "&#060;/li&#062;"<BR> strOutput = strOutput & "&#060;ul id=&#039;foldinglist&#039; style=&#039;display:none&#039; style=&{head};&#062;"<BR> rstRS2.MoveFirst<BR> Do while not rstRS2.eof<BR> strOutput = strOutput & "&#060;li&#062;" & rstRS2("Con_Name") & "&#060;/li&#062;"<BR> rstRS2.MoveNext<BR> Loop<BR> strOutput = strOutput & "&#060;/ul&#062;"<BR> Response.Write(strOutput)<BR> End If<BR> rstRS1.MoveNext<BR> Loop<BR>%&#062;<BR> &#060;/ul&#062;<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Writing Data to Tree Structure

    You don&#039;t even have the logic in the code to differentiate between the folders. Is that all of the code you have? You could probably apply a filter to the recordset to differentiate between the folders. Something like this:<BR>&#039;create an array of your folders<BR>for i = 0 to Ubound(aFolders)<BR>rstRS2.Filter = "folderGroup = " & aFolder(i)<BR>&#039;loop through and populate the components here<BR>&#039;finish the loop....<BR><BR>BTW I bet no one replied because your code was not indented, therefore too difficult to decipher. The easier your post is to understand, the faster you will get responses.

Posting Permissions

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