PDA

View Full Version : Treeview using javascript



srikanthgoud
01-30-2009, 06:06 AM
1) Script Title: jQuery TreeView Menu (v1.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...emo/index.html

3) Describe problem: Not able to call the function from body

Hi,

Iam working to build a tree using javascript. And i

http://www.dynamicdrive.com/dynamici...emo/index.html

in this Demo#2 which matches to my requirement very much.
So, i downloaded jquery.treeview.zip.

Know, i am not understanding which js files to include.
and also how to call the function in body tag.

Srikanth

Nile
01-30-2009, 09:14 PM
Please post a link to the page on your site that contains the problematic script so we can check it out.
Please include your code so that we can take a look at it, we can't do much without it.
The link that you have directed us to is broken. Please provide a correct link so we can take a look.

Can you be more descriptive in what you need help with?



$("#browser").treeview({
animated:"normal",
persist: "cookie"
});

$("#samplebutton").click(function(){
var branches = $("<li><span class='folder'>New Sublist</span><ul>" +
"<li><span class='file'>Item1</span></li>" +
"<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
$("#browser").treeview({
add: branches
});
});

The red highlighted tells the speed of the drop. It can be slow, normal, or fast or you can set a integer value such as 500, within 500 miliseconds it will be dropped.

The blue highlighted tells the persist state. Since it's set to cookie it will create a cookie every time you change the +/-. Once you refresh - it will be the same as it was before(for example:

-Folder1
+Folder2
&&File1
&&File2
Will be the same as it is above if you do refresh the page.

The green is to be added when you click a div with the id of samplebutton.

I hope this helps,
Nile.