Wednesday, May 16, 2012

how to grow the ul and ol list elements of a tree using javascript

I have to make a tree such that it allows the list to be generated dynamically just by clicking on it.for example



o 1
o 2
o 3


if in this, I click on 1 , a sub node should be created may be 11.clicking on the 1 again will create may be 22.



o 1
o 11
o 22
o 2
o 3


this process will be repeated how many times I will click on the element. one scenario may be like this.



o 1
o 11
o 111
o 222
o 333
o 22
o 33
o 111
o 222
o 333


I have absolutely no idea of jquery framework as I have never worked on that syntax all I understand that too a little about javascript. can you guide me regarding in this direction so that i may integrate in the project which is like this.



I have to generate knowledge based help module which contains several folder list which itself contains folders and each folder has data to be shown to the agent.



for ex



folder1
folder1.1
folder1.2
folder1.3
folder1.4
folder1.4.1
folder1.4.2
folder1.4.3
folder1.5


this structure would be shown using tree data structure, each folder contains the data. This folder structure would grow/ can grow dynamically.





No comments:

Post a Comment