Changes in this version:
- tree now allows for some node sizing (see demo)
- fixed bug when created nodes did not have the leaf class (by addwin)
- optimized rtl position and images
- fixed changing focus when closing focused node (by Karf)
- fixed before- callbacks parameters (by Colin)
- fixed dragging position (by Karf)
- returned optional path parameter (by Karf)
- added ondblclk callback, which defaults to toggle and then select node (by Arno)
- tree object is passed as final argument in every callback
Still no time to finish the documentation – I hope I will get round to it soon.

Hi
This seems to be a good component and meets my requirement.
I am looking for XML tree. I deployed the source to my Weblogic, and accessed it through http://localhost:7001/lilly/javascript/jsTree/examples/
I could see few nodes for HTML tree but nothing for JSON or XML. Got following error in firebug
Firebug’s log limit has been reached. %S entries not shown. Preferences
GET http://localhost:7001/lilly/javascript/jsTree/examples/nested.xml 35ms jquery.js (line 29)
GET http://localhost:7001/lilly/javascript/jsTree/_source/nested.xsl 4ms jquery.js (line 29)
r.setProperty is not a function jquery.xslt.js (line 110)
[Break on this error] r.setProperty( ‘SelectionNamespaces’,…ttp://www.w3.org/1999/XSL/Transform”‘ );
Greetings
Alpesh
I am sorry but I cannot reproduce your problem, could you upload to a web server?
I am also seeing the similar error in firebug.
“r.setProperty is not a function.” Clicking on it takes me to ‘line 110′ of ‘jquery.xslt.js’ file which is this line below:
” r.setProperty( ‘SelectionNamespaces’, ‘xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”‘ );”
Steps to reproduce:
1. Download the jstree RAR file.
2. Unzip the file with WinRAR.
3. Open the index.html file under “\jsTree.v.0.6.5\examples\ folder in firefox with firebug enabled.
Please keep in mind that I am running this under windows environment.
I am trying develop a proof of concept for a component using this jstree component for our project. We really liked the flexibility of this component, such as multiple selection, drag and drop within the same node allowing reorder, JSON and XML support etc. But unfortunately we have a short window of a week to make it work before we switch to a different API if we need to.
Thank you and will very much appreciate your help.
Fahim
@Fahim
I believe the problem is caused by the script running from the filesystem and not from a web server.
I believe it is a security restriction.
Hope this helps – drop me a line if it doesn’t.
First of all, I must say that I love this plugin. It’s simply awesome.
There are a couple things that I see the need for though.
1) Being able to put checkboxes/radios in front of (or in place of) list items. I do a lot of work with ecommerce sites and it’d be really hand if I could use your tree plugin so that people could pick the categories they want their items in and then submit this via post.
2)Built in Doubleclick and Rightclick handlers. A rightclick menu could simply be a div some place in the ul with a special id. A rightclick context menu would be AWESOME! The same goes for being able to attach a doubleclick handler (no not the jquery default one…I want one that I can config to work with jstree).
3)More documentation…..I get the feeling that there’s so much more in this that I’m missing. I’ve been looking over the source code and so far I’ve found several really useful things that I would not have noticed by reading your documentation.
Thanks! Let me know if you want help adding these things at all!
@Atom
I’m glad you liked the plugin.
1) As for the checkboxes – I’ll consider it for the next version – I believe it won’t be tough to implement – just a little CSS and JS tweaking.
2) There is a doubleclick event handler – it is called ondblclk – in the settings.callback object. It defaults to select and open/close the node.
As for the right click event – I’ll get to it right away it is indeed useful.
3) Yeah. :( I know. I hope I will get round to building a good documentation soon. Note taken! :)
Hi Vakata – I’ve got another feature request – and it’s quite a biggie. I’m using the JSON method for populating the tree, and some of the trees are very large (one is resulting in a 3MB JSON string). Some other tree components have the ability to dynamically load a subfolder’s contents as and when it’s opened. This would be a great addition.
I have a suspicion that this could kind of already be achieved, by adding a placeholder “Loading” node as a child of any nodes that have children (in order to force display of the [+-] open/close link), then onopen, loading the children via AJAX, and setting them as child nodes, before refreshing the tree.
If this is going to be the best way I’ll look into it further, but it’d be really nice to have support built right in.
On the other hand, if it’s already in there, and I’ve just missed it, please point me in the right direction! :)
Just curious when your planning to release another version…Is it possible to get a daily/nightly SVN update?
@Colin
I’ve been planning this feature for quite some time. Even the first version of the tree supported such functionality, but attached to callbacks. In the XML data source you could set the state to closed, even if the node has no children and load the contents onopen. As for the JSON data source – such state option is not included.
Still, all this is just workarounds – I am going to implement it in the tree so that it is native and there is no need for callback play. I will start working on that right away.
In the mean time – your idea is quite right. Put a placeholder node called loading (you could even assign a loading icon ;)) inside the node that is to be loaded async. In the config attach the callback like this.
Example:
…
onopen : function(NODE, TREE_OBJ) {
$.getJSON(“urlhere.php?node_id=” + NODE.id,
function (data) {
$(NODE).replaceWith(TREE_OBJ.parseJSON(data));
});
}
…
Your JSON should have a root node – the node that just got opened. This is why I’m using replaceWith.
This is just a quick and dirty solution I came up with but I hope it helps and gets the job done.
I’ll start working on the native implementation right away.
@Atom
I still have some testing to do on the rightclick implementation just to be sure everything is OK, and some testing to do on the multiple_on option – which could be used to have the user select many nodes without holding Ctrl, and deselect any of them by clicking again. This way you could easily attach your functionality (the checkbox idea) to the tree by simply writing a CSS line to have the selected nodes with a checked icon and then read the selected_arr array.
Thanks – that’s brilliant as usual!
I’ll hopefully have a chance to have a play with the workaround over then next few days, but will look forward to the native version.
Really looking forward to this next version….is Monday a possibility?
We are implementing jsTree in our CMS, it works great but I still got a few questions. What is the callback for a mouse-click to open the url. When clicking on a node it just selects it but does not activate the link. At this moment we are using the onchange callback, it works but is also gets activated when using the cursor-keys.
Is it possible to lock the tree while updating the tree in the database?
Thanks.
Is it possible to change the default text for a new node without changing tree_component.js? The same goes for the error messages.
Thanks.
@addwin
The first issue is something I’ve been thinking about, and a colleague of mine suggested that the keys should actually move the hover state only, and not select the node (not until for example Enter is pressed). I’ll implement this shortly. You could modify the script to pass a parameter when the select was triggered by the get_* functions used for keyboard shortcuts. Anyway – I’m writing it down – it shall be ready soon.
As for the lock – it is a wonderful idea – thanks. I believe it will be easy to implement.
Last but not least – the language versions – I will most probably add a language object to settings object.
I have version 0.7 (major improvement is native async mode) ready, but I guess I’ll postpone it for a few days and include those features.
Thanks for the ideas,
Ivan
when i ran this tree example, it had an error:
r.setProperty is not a function
[Break on this error] if(r){r.setProperty(‘SelectionNamespaces…arseFromString() failed’);return false;}
so the tree cannot be loaded.
why? how to fix it?