How to change icon in jstree?
After an headache… I found a solution. <li data-jstree=”{“icon”:”path/file.png”}”></li> I suggest to don’t modify the css code. PS The “types” plug-in is not necessary.
After an headache… I found a solution. <li data-jstree=”{“icon”:”path/file.png”}”></li> I suggest to don’t modify the css code. PS The “types” plug-in is not necessary.
Irishka pointed me in the right direction, but does not fully resolve my problem. I fiddled around with her answer and came up with this. Using two different server functions is done only for clarity. The first one lists all products at top level, the second one lists all children of a given productid: jQuery(“#introspection_tree”).jstree({ … Read more
Answers to your questions. Am I going in the right direction?. You can modularize your code better. Is there any other way to use jsTree with Ember?. I don’t know what you have in mind, but you have to wrap jQuery interface in something. Is there any Ember extension like jsTree?. Take a look at … Read more
Just wanted to chime in here as none of the answers worked for me. What finally DID work was very simple: $(‘#someTree’).jstree(‘select_node’, ‘someNodeId’); Note that I didn’t initialize someNodeId as a jQuery object. It’s just a plain string. I did this right after a tree was loaded without putting it into a “ready” bind event … Read more
The jsTree documentation is “sub optimal”. The docs don’t clearly state that the initialization works asynchronously. There’s core.loaded(): A dummy function, whose purpose is only to trigger the loaded event. This event is triggered once after the tree’s root nodes are loaded, but before any nodes set in initially_open are opened. This suggests an event … Read more
Turns out is is as simple as calling: tree.jstree(“refresh”);
The contextmenu plugin already has support for this. From the documentation you linked to: items: Expects an object or a function, which should return an object. If a function is used it fired in the tree’s context and receives one argument – the node that was right clicked. So rather than give contextmenu a hard-coded … Read more