Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help replicating directory structure with ColdFusion and jsTree
    text
    copied!<p>I am using this new jQuery plugin called jsTree www.jstree.com and using the HTML datasource.<br> I am also using ColdFusion 7 with cfdirectory and filtering out files, so just dirs. I need to recreate the directory structure in the image, well any dir structure I give it actually. I am having a heck of a time with the logic. variables.imageDirectoriesLen = 8 in this scenario cause I am outputting from the middle of the actual file path, not from begining.</p> <p>Thanks for the help.<br> Derek </p> <p><a href="http://i41.tinypic.com/2yjsirl.png" rel="nofollow noreferrer">alt text http://i41.tinypic.com/2yjsirl.png</a></p> <p>this is what I have so far</p> <pre><code>&lt;cfoutput query="clientImageDirsFilter"&gt; &lt;cfset nextLen = 0 /&gt; &lt;cfset nextDir = "" /&gt; &lt;cfset nextRowCnt = currentRow+1 /&gt; &lt;cfset nextDir = clientImageDirsFilter.directory[nextRowCnt] &amp; "\" &amp; clientImageDirsFilter.name[nextRowCnt] /&gt; &lt;cfset nextLen = listLen(nextDir, "\") /&gt; &lt;cfset currLen = listLen(clientImageDirsFilter.directory &amp; "\" &amp; clientImageDirsFilter.name,"\") /&gt; &lt;cfif currLen eq nextLen&gt; &lt;li rel="folder" id="node_#randRange(1,99999)#"&gt;&lt;a href="##"&gt;&lt;ins&gt;&amp;nbsp;&lt;/ins&gt;#clientImageDirsFilter.name#&lt;/a&gt;&lt;/li&gt; &lt;cfelseif nextLen lt currLen&gt; &lt;cfif nextLen eq 0&gt; #repeatString("&lt;/li&gt;&lt;/ul&gt;",(currLen-nextLen-variables.imageDirectoriesLen))# &lt;/cfif&gt; &lt;cfelse&gt; &lt;ul&gt; &lt;li rel="folder" id="node_#randRange(1,99999)#"&gt;&lt;a href="##"&gt;&lt;ins&gt;&amp;nbsp;&lt;/ins&gt;#clientImageDirsFilter.name#&lt;/a&gt; &lt;ul&gt; &lt;/cfif&gt; </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload