• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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: 67645
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic