Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

jQuery File Tree -- building you own tree

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use the jQuery File Tree plugin (found at http://www.abeautifulsite.net/jquery-file-tree/). I've been able to install it and get the demo working, so that I can provide a value for the root and see the files and folders on my local box. Eventually, I want to be able to information to the page from my application server and have the page display those folders and files. In my example, the left side is more or less what the demo provides on the web site I downloaded the plugin from. The right side shows a tree that I was able to put together by setting up unordered lists and list items. I just created a few of them and named them the same as the ones on the LHS (showing the contents of my C:\Windows folder). I have two questions: why won't the folders collapse and how can I get the file on in the tree I created (the one on the RHS) to return the filename in an alert box like files on the LHS do?

I've tried duplicating the jQuery block that refers to the fileTreeDemo_1 id (with the id changed to fileTreeDemo_Mine). However, when I do this, it just shows the contents of my C:\ directory (I think) and ignores the file structure I specified. I've included a copy of my code, here (some CSS omitted to make the code listing shorter):

 
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know anything about that plugin, but if it works like many jQuery plugins, it's going to create its own DOM under your element, so your list elements (I have no idea why you're putting those there in the first place) are likely being replaced by the plugin with its own structure.
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic