Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1051353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:55:02+00:00 2026-05-16T16:55:02+00:00

Started playing around with jQuery and the jsTree plugin yesterday, and have it successfully

  • 0

Started playing around with jQuery and the jsTree plugin yesterday, and have it successfully loading the tree with an AJAX call to a servlet. Now, I would like to have the tree open all the nodes after loading so I added a success function to the ajax attribute. However, I cannot seem to get the open_all() method to work properly. I’m very new to working with jQuery so I’m guessing it’s something simple that I’m doing wrong.

Firebug isn’t showing any errors which rules out the dumb error of mistyped method name. I checked the documentation and I think I’m doing everything correctly according to what I read. The tree is loading correctly, but not opening all the nodes after the page loads.

I’m using jQuery 1.4.2 and jsTree 1.0rc2 on Firefox 3.6.8.

Here’s the code I’m using to load the tree and attempt to open all the nodes in the tree:

// Create the tree object
$("td#modelXML").jstree({
    core : { "animation" : 0 },
    //xml_data : {"data" : "" + xml, "xsl" : "nest"},
    xml_data : {"ajax" : 
                    {"url" : "servlet/GetModelHierarchy", 
                    "type" : "post", "data" : { modelId : "" + modelId} }, 
                    "xsl" : "nest",
                    "success" : function(){
                                $(this).open_all(-1);
                                }
    },
    themes : {"theme" : "classic", "dots" : true, "icons" : true},
    types : { 
        "types" : {
            "category" : {
                "valid_children" : ["factor"]
            },
            "factor" : {
                "valid_children" : ["level"]
            },
            "level" : {
                "valid_children" : "none",
                "icon" : {
                    "image" : "${request.contextPath}/jsTree/file.png"
                }
            }
        }
    },
    plugins : ["themes", "types", "xml_data"]
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:55:02+00:00Added an answer on May 16, 2026 at 4:55 pm

    You have to hook into the events, and then call open_all.

    To have all nodes open on load, use:

        var tree = $("#id-or-selector-for-my-tree-element");
        tree.bind("loaded.jstree", function (event, data) {
            tree.jstree("open_all");
        });
    

    Do the above, before you initialize the tree with .jstree({...}).

    If you refresh it, then to have all nodes open again, you have to use:

        tree.bind("refresh.jstree", function (event, data) {
            tree.jstree("open_all");
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am playing around with MVC and have started setting up an existing site
Recently I have started playing with jQuery, and have been following a couple of
A few years ago we started playing around with XForms from the W3C for
I have just started playing with the ASP.Net MVC framework, and today I created
Have just started playing with ASP.NET MVC and have stumbled over the following situation.
I am playing around with parsing JSON in jQuery and I am having trouble.
I've been playing around with http://nixboxdesigns.com/projects/jquery-lavalamp/ for a navigation menu on a new site
I started playing around with OpenGL and GLUT. I would like to draw some
I started playing around with Pascal Script today and I cannot find any good
Just started playing around with, how is everyone linking up their component ids ?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.