Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy doesn't jsTree open_all() work for me?
    primarykey
    data
    text
    <p>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.</p> <p>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.</p> <p>I'm using jQuery 1.4.2 and jsTree 1.0rc2 on Firefox 3.6.8.</p> <p>Here's the code I'm using to load the tree and attempt to open all the nodes in the tree:</p> <pre><code>// 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"] }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload