File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write a javascript function to exapand/collapse all nodes in a TreeMenu

 
Keerthi Chandhu
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to write a javascript function to collapse/expand all nodes in a tree menu.
Could anyone please give me some idea how to write this function?

Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's your code?
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4116
195
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agree with Bear,

It depends on your implementation.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you need a starting place:
  • onclick
  • obj.style.display="none"


  • Eric
     
    Keerthi Chandhu
    Greenhorn
    Posts: 16
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,

    Please find my code.


    I am trying to write a function like
    If user clicks a collapse all button it should collapse entire tree view nodes.
    I do not understand how to check the condition to find whether a tree is expanded or not. if( tree.Expanded){

    Any suggestions would be appreciated.


    Thank you.
     
    Eric Pascarello
    author
    Rancher
    Posts: 15385
    6
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    And what is the tree that you are using? There are 1000's of them out there.

    Eric
     
    Keerthi Chandhu
    Greenhorn
    Posts: 16
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I am using java script and jsp to create a TreeMenu which is dynamically driven from database.
    I am using JSP and Jdbc to get tree node names from database and calling javascript fuction to create the tree and able to create tree.
    I am looking for help in writing expand all/collapse all nodes function for a treemenu.

    I hope this the information you are looking for,else I can provide more information.


    Thank you.
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic