Results 1 to 2 of 2

Thread: Treeview using javascript

  1. #1
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Treeview using javascript

    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

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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?

    Code:
    $("#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.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •