jstree

Setting line-height on a jsTree?

百般思念 提交于 2019-11-29 15:21:30
I'm using jstree to create a multi-level tree, and I want to be able to set a larger line-height than you usually see, so that I can have some large headings. (If I set the font larger, the lines simply overlap.) I've tried setting the line-height CSS property on the li and a elements, but neither have an effect; jstree seems to be programmatically overriding those values. (I even tried using jQuery to re-set those values after the tree is created, but that didn't help.) To make things more complicated I would like to have different levels have different spacing, so that the top levels can be

How to get I get leaf nodes in jstree to open their hyperlink when clicked when using jstree ui

老子叫甜甜 提交于 2019-11-29 14:26:15
问题 I display a hierachial structure using jtree, the data is as follows <div id="songchanges"><ul> <li id="phtml_1"> <a href="#">C:</a> <ul> <li id="phtml_2"> <a href="#">Music</a> <ul> <li id="phtml_3"> <a href="#">Z</a> <ul> <li id="phtml_4"> <a href="#">Hans Zimmer</a> <ul> <li id="phtml_5"><a href="FixSongsReport_00107_2013-09-04-11-11-55_body_blqxgT7E7YOmnBbjFXQGUg==.html">C:\Music\Z\Hans Zimmer\Hannibal</a></li> </ul> </li> <li id="phtml_6"> <a href="#">The Zombies</a> <ul> <li id="phtml_7

Jstree nodes don't work when ui plugin is used

天大地大妈咪最大 提交于 2019-11-29 14:04:58
I've found that using the ui plugin breaks the links for the tree nodes. This isn't anything new, I've found references to this problem elsewhere. The first cause was a problem with v1.6 of the jquery validation plugin. I'm not using that plugin, so that can't be the cause. I also found a good posting describing a few ways of adding the jstree-clicked class to the <a> tag. That looked promising, but when I tried it I didn't notice any difference. Here is a very simple example: <div id="treediv"> <ul> <li id="page1"><a href="http://www.yahoo.com" class="jstree-clicked">YAHOO!</a></li> </ul> <

jsTree asynchronous search - trigger load new nodes

て烟熏妆下的殇ゞ 提交于 2019-11-29 11:54:40
I have a nicely running implementation of jsTree running on a project of mine. The JSON data is provided by PHP/Ajax. I've run into some trouble while using the search plugin. jsTree's search plugin documentation says: so in your response you must return the path to the node (without the node itself) as ids: ["#root_node","#child_node_3"] ...so, my server side search function is returning a path to the matched node like so (yes, I'm json_encode ing it): Array( '#1', '#2', '#3', '#5' ); // to match node #10 (leaf node) at the end When these values already exist in the DOM, the client side

JSTree - Load nodes dynamically

眉间皱痕 提交于 2019-11-29 11:18:57
I'm using jstree v.3. I have a working example, where all the data is downloaded once from the server side via ajax. $('#tree').jstree({ 'core': { 'data': { 'url': "/ajax/getAll", 'data': function(node) { return {'id': node.id}; }, // "check_callback" : true } }, "types": { "category": { "icon": "/img/category.png" }, "page": { "icon": "/img/page.png" } }, "plugins" : ["types"] }); But I have A LOT of data to present. I want to load data for items, that were clicked. I don't have problems with server side, but I can't find examples for jstree part. Can anybody share the code or give advise?

How can I attach custom behaviour to a double click in jsTree?

妖精的绣舞 提交于 2019-11-29 11:05:07
问题 I'm using the jsTree jQuery plugin and want to execute code when the user double clicks a node. I can't seem to get it to work. I found some documentation on a ondblclk event but it doesn't fire. browser.jstree( { plugins: ["themes", "json_data", "ui", "cookies"], callback: { ondblclk: function (node, tree) { if (!thisReportBrowserthis._isFoldersOnly) { var f = node; } } } } ); How can I handle double click events with jstree ? 回答1: It turns out I can do this: jstree.bind("dblclick.jstree",

Why doesn't jsTree open_all() work for me?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 05:54:14
问题 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

How can I refresh the contents of a jsTree?

限于喜欢 提交于 2019-11-29 04:24:50
问题 I have loaded a jsTree with an AJAX call that returns JSON data. How can I refresh the tree so that it reloads its contents? 回答1: Turns out is is as simple as calling: tree.jstree("refresh"); 回答2: At version 3 you can reload the tree : $('#treeId').jstree(true).settings.core.data = newData; $('#treeId').jstree(true).refresh(); 回答3: var tree = jQuery.jstree._reference("#files"); tree.refresh(); or var tree = jQuery.jstree._reference("#files"); var currentNode = tree._get_node(null, false); var

jstree disable checkbox

假如想象 提交于 2019-11-29 04:21:36
I am currently working on some POC using JS Tree plugin and related check box plugin. For certain nodes I need to check the check box by default and disable any further selection.I found the function to hide the check box .bind("load_node.jstree", function (e, data) { $(this).find('li[rel!=file]').find('.jstree-checkbox:first').hide(); }); instead of hiding the check box completely I want to find a way to disable check box for certain nodes mcabral You will need to define a "disabled" type (using the types plugin) and then assign that type to the desired node. Take for instance this "disabled"

creating a new node in jstree

谁都会走 提交于 2019-11-29 04:02:58
I am creating a node by using crrm as below $("#TreeDiv").jstree("create", $("#somenode"), "inside", { "data":"new_node" }); This function is called through a wizard (i.e I am creating a node in place). So far I am successful to get a node under #somenode in that tree. The problem when the new node is created it appears focused and still editing of the node name is observed. Screenshot below - How can I disable this editing programatically I know it's old question, but i've used a lot of time searching for an answer to this and kept finding older question with this answer, so maybe this update