Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 752751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:49:04+00:00 2026-05-14T14:49:04+00:00

I am using this new jQuery plugin called jsTree www.jstree.com and using the HTML

  • 0

I am using this new jQuery plugin called jsTree http://www.jstree.com and using the HTML datasource.
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.

Thanks for the help.
Derek

alt text

this is what I have so far

<cfoutput query="clientImageDirsFilter">
<cfset nextLen = 0 />
<cfset nextDir = "" />
<cfset nextRowCnt = currentRow+1 />

<cfset nextDir = clientImageDirsFilter.directory[nextRowCnt] & "\" & clientImageDirsFilter.name[nextRowCnt] />
<cfset nextLen = listLen(nextDir, "\") />
<cfset currLen = listLen(clientImageDirsFilter.directory & "\" & clientImageDirsFilter.name,"\") />

<cfif currLen eq nextLen>
<li rel="folder" id="node_#randRange(1,99999)#"><a href="##"><ins>&nbsp;</ins>#clientImageDirsFilter.name#</a></li>
<cfelseif nextLen lt currLen>

    <cfif nextLen eq 0>
        #repeatString("</li></ul>",(currLen-nextLen-variables.imageDirectoriesLen))#
    </cfif>

<cfelse>                                        
<ul>
    <li rel="folder" id="node_#randRange(1,99999)#"><a href="##"><ins>&nbsp;</ins>#clientImageDirsFilter.name#</a>
        <ul>
</cfif>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:49:04+00:00Added an answer on May 14, 2026 at 2:49 pm

    I use a slightly modified version of the recursive function Camden wrote. It should do what you want.

    <cfset initialDir = "C:\myrootdir">
    <cfdirectory directory="#initialDir#" recurse="yes" name="files" sort="type asc">
    
    <cfquery name="test" dbtype="query">
        select * from files where name <> 'Thumbs.db'
    </cfquery>
    
    
    <div id="basic_html">
            <cfset display(test,initialDir)>
    </div>
    
    <cffunction name="display" returnType="void" output="true">
        <cfargument name="files" type="query" required="true">
        <cfargument name="parent" type="string" required="true">
        <cfset var justMyKids = "">
    
        <cfquery name="justMyKids" dbtype="query">
        select  *
        from    arguments.files
        where   directory = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.parent#">
        </cfquery>  
        <ul>
        <cfoutput query="justMyKids">
            <cfif type is "Dir">
                <ul><li><a href="##"><ins> </ins>#Replace(name, "_", " ", "All")#</a> #display(arguments.files, directory & "\" & name)#</li></ul>
            <cfelse>
                <cfset fileURL = Replace(Replace(directory, initialDir, "", "All"), "\", "", "All") & "/" &  name>
                <li class="close"><a href="#fileURL#"><img src="http://localhost/globalincludes/interface/includes/js/jquery_plugins/jsTree/file.png" border="0"> #Replace(name, "_", " ", "All")#</a></li>
            </cfif>
            </li>
        </cfoutput>
        </ul>   
    </cffunction>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 368k
  • Answers 368k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Entity Framework designer is terrible - I've had the… May 14, 2026 at 5:11 pm
  • Editorial Team
    Editorial Team added an answer If by "hijack" you meant sniff the packets then what… May 14, 2026 at 5:11 pm
  • Editorial Team
    Editorial Team added an answer If you want two actions to be atomic, embed them… May 14, 2026 at 5:11 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.