I have a list of strings with are paths to some file with "/" separator that are available to my jsp/html page . i.e.
d1/d2/d3/file1.c
d1/d2/d3/file2.java
d1/d2/file3.jsp
d1/d2/file4.asp
d1/d2/d3/d4/file4.asp
d11/d22/d33/file5.txt
The above list of string paths are available to my page. I need to make a dynamic tree structre with above data in below tree structure using javascript.
+d1/d2/
file3.jsp
file4.asp
+d1/d2/d3/
file1.c
file2.java
+d1/d2/d3/d4/
file4.asp
+d11/d22/d33/
file5.txt
When I click on the common path like +di/d2 it should expand to show all the files under that directory , and when again click on it should hide the child files. Simmilarly for all other nodes.