Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get jstree to close/open if you click on folder icon not just the triangle icon
    primarykey
    data
    text
    <p>I'm using jstree on my html page I like to be able to open and close parts of the tree by clicking anywhere on a the row (i.e ie, the small triangle icon, folder icon, and folder name.) rather than having to click the small triangle icon.</p> <p>Here is a full self contained example to demonstrate the problem.Id like to be able to close the C:\Music folder by clicking on the folder icon or 'C:\Music' is that possible ? </p> <pre><code>&lt;!DOCTYPE html&gt;&lt;html xmlns="http://www.w3.org/1999/html" xml:lang="en" lang="en"&gt; &lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt; &lt;link rel="stylesheet" type="text/css" href="../style/songkong.css"&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt; &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.cookie.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.hotkeys.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.jstree.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" class="source below"&gt; $(function () { $("#songchanges") .jstree({ "plugins" : ["themes","html_data","ui","crrm","hotkeys"], "core" : { "initially_open" : [ "phtml_1" ] } }) .bind("loaded.jstree", function (event, data) {}) ; $("#songchanges").bind("open_node.jstree", function (e, data) { data.inst.select_node("#phtml_1", true); }); }); &lt;/script&gt;&lt;/head&gt; &lt;body&gt; &lt;div id="songchanges"&gt;&lt;ul&gt; &lt;li id="phtml_1"&gt; &lt;a href="#"&gt;C:\Music\&lt;/a&gt; &lt;ul&gt; &lt;li id="phtml_2"&gt; &lt;a href="#"&gt;KungFooFighting1.mp3&lt;/a&gt; &lt;/li&gt; &lt;li id="phtml_3"&gt; &lt;a href="#"&gt;KungFooFighting2.mp3&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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