FAQ Database Discussion Community


How to not repeat folders with JStree?

javascript,json,jstree
I have a JSON file with some data like this: dataTree.json = [ { "datap": "816816816816816818", "name": "image1.jpg", "url": "/files/folder1/test/d2e9c54ceedc9/image1.jpg", "path": "/files/folder1/test/image1.jpg", "size": 35969 }, { "datap": "857022de4fccdcb54623ff6185daae706a47140c", "name": "image2.jpg", "url": "/files/folder1/pruebas/85623ff6185d7140c/image2.jpg", "path": "/files/folder1/pruebas/image2.jpg", "size": 17689282 }, { "datap": "b260ec3250420c953a9db41897c34e3551620ec325035516256b2/image3.jpg", "path":...

jsTree search textbox does not appear

javascript,jquery,jstree,jstree-search
I am using jsTree (http://www.jstree.com/plugins/) with below plugins "plugins" : [ "dnd" , "contextmenu" ,"ui" , "types" , "search" ,"sort" ] All plugins are working fine except search.There is no search textbox added above tree to search node.Is there any other dependency to use search in jsTree. Please help....

Drag and Drop Jstree confirmation

jquery,drag-and-drop,jstree
I developped a confirmation alert that appears do you want to move this file or folder ? if i click no: it return to default folder. if yes it wil go to the new folder. So my problem is that when i drag and drop a parent folder the confirmation...

jsTree with checkbox and state plugin forget checked checkboxes

jstree
Using jsTree with checkbox and state plugin, each time I check some checkboxes and reload page they are still checked. How is possible to use state plugin with checkboxes, but "forget" checkbox state (leaving opened and selected node state as is). plugins : ["grid", "state", "dnd", "types", "checkbox"], I created...

jstree html and json

javascript,jquery,ajax,scala,jstree
I am using JSTree to create a tree structure of the data I have. I am using Scala templates. The templates files create the html. the html has a SJTree div tag and also displays the first level subtree correctly, but I want to make an ajax call to expand...

different tree view icons and enable/disable checkboxes in jstree

javascript,jquery,jstree
I need to change the tree view icons and enable/disable checkboxes please view the code below : function LoadJSTree() { $.noConflict(); $(function () { $('#demoTree').jstree({ 'checkbox': { 'keep_selected_style': false, 'two_state': true }, "types": { "#": { "max_children": 1, "max_depth": 4, "valid_children": ["root"] }, "root": { "icon": "/static/3.1.1/assets/images/tree_icon.png", "valid_children": ["default"], "check_node":...

jstree checkbox plugin and node link conflict

jstree
I am implementing jsTree with grid and checkbox plugin. All is working fine, but if I set jsTree a_attr.href, then it is conflicting with checkbox events. So when I click on node - it should follow the link, if I click on checkbox - it should be marked. What I...

inserting data from jstree into database

php,mysql,jstree
I'm having certain trouble to figure how I can receive a set of ids or the complete node info and use that data to insert the correspondent row into the db. Why is this happening? Well, I have the following hierarchy projeto>uc>ambiente>secao>med. In my JS tree I'm using lazy loading...

jsTree open_all only showing last item in JSON array

javascript,jquery,json,jstree
I am relatively new to working with jQuery and jsTree. In my application I call an API, and then want to display the resulting JSON using jsTree. For my sample I am using this fake API call http://jsonplaceholder.typicode.com/posts/?userId=1 However, when the page loads, only the last item in the array...

jsTree disable some of the checkboxes

jstree
Using jsTree (3.1.0+) with checkbox plugin is it possible to allow not all checkboxes to check - disable some of them? I found solution for old versions of jsTree here jstree disable checkbox but it didn't work on jsTree 3.1.0+ versions. Solution of hiding checkbox jsTree Hide Checkbox is working,...

JsTree : How to get event when droping node from a tree to a second tree?

javascript,jstree
I've read the documentation but I didn't find the solution. Here's an simple example where I want to catch the event when I drop in tree_1 a node from tree_2: http://jsfiddle.net/superjames/fumkdwqy/1/ HTML: <div id="container"> <ul> <li data-jstree='{"opened":true}'>First tree <ul> <li>Child node 1</li> <li>Child node 2</li> </ul> </li> </ul> </div> <br/><br/><br/>...

jstree-grid issue when attempting to show only matches

javascript,jstree,jstree-search
I'm using jstree, the built-in search plugin, and jstree-grid plugin. What I'm trying to do is use the show_only_matches option for the search so only matching nodes are shown, the rest are hidden. This is where my issue comes in. I'm using the jstree-grid plugin and even though the search...

jstree I need fire $.vakata.dnd.start with multiple drag

javascript,jquery,jstree
how I can make multiple drag and drop in jstree? I have jstree and 3 div(s) I need select the 3 divs and drag into jstree , means I need make multiple drags to jstree I need fire $.vakata.dnd.start with multiple external drag how I can use it my code...

jsTree 3: use a drag handle to restrict initiating dragging

javascript,drag-and-drop,jstree,jquery-ui-draggable,jstree-dnd
Using jsTree 3.0.8 I want to allow nodes to be dragged and dropped within the tree, but it should only allow that action if it was initiated by a drag on a specific button or "drag handle", instead of the default behavior of allowing dragging anywhere on the row. I...

Change icon on click jstree

javascript,css,meteor,jstree
I have this code using jstree plugin. $(".gems-tree").on('changed.jstree' , function( event , data ){ console.log("folder clicked"); }); And it works, but now i want to change the icon from the folder to close to open, is there a way to achive this? NOTE Already try with data.node.state.opened = true just...

jstree in complex environment & coffee not showing any icons nor outline

jquery,coffeescript,jstree
I included (jquery) jsTree in my already complex environmemt, and using coffee script, I got a fast 'it works' but now i stuck with no images showing nor getting any outline of the tree displayed Although I think my prob is behind CSS I tell: I want to populate jstree...

Node Webkit and Web SQL error inserting JSON

javascript,jstree,node-webkit,web-sql
I'm just starting with Node-Webkit (NW.js as it is now) and I am trying to use Web-SQL to store data. Creating the database works fine, exactly as in the examples, and generally inserting data works fine, again as in the examples. However when I come to insert a JSON object...

Unable to dynamically load Json Arrays from JSP to a Jstree

json,jsp,model-view-controller,jstree,jtree
I was trying to make a simple LDAP client to just retrieve the data from an LDAP server. I am returning array of JSON objects from the JSP. On click of any value I will get some data from online server. I am able to load the first set of...

JsTree with custom json data

javascript,jquery,json,structure,jstree
I have this structure in json I can not be modified by request. { "allowedUrls": [ { "url": "http://www.google.com" } ], "id": 1, "name": "Redirection Rule", "redirectActivation": { "frequency": 1, "trigger": 1 }, "redirectSet": { "httpDestination": "Redirect Url", "responseCode": 301 } } I need to use this structure to populate...

How can I find the minimum browser requirement for JsTree 3.1.1

jquery,firefox,jstree,minimum-requirements
I am trying to figure out the minimum requirement for my application which is using JsTree 3.1.1 Is it any way to find out the very first browser version that supports features used in JsTree 3.1.1? Bonus: In general, how can I find the minimum requirements if the documentation does...

JavaScript not equals event from jstree

javascript,jstree
I have created a tree in Javascript (using jstree) and I am listening to an for events when someone selects a node. I take the type of node from the data that is passed in and want to execute some code if the type is not default. When I step...

How to refreseh jsTree with new JSON data?

javascript,jquery,json,tree,jstree
I have a file upload element which upon change, scans the file names and does something to get a VALID treeJSON variable (I've checked, my function works.). Now when the function detects a change the second time, obviously treeJSON is going to update and I want it to update the...

Jstree JSON as Variable Java

java,jquery,json,jstree
I hav JSON data in the form of a string that I set as an attribute in my servlet. request.setAttribute("json", json); I need to put this into a jstree from the jstl tag. I know I can't put the jstl straight into javascript so I did the following: <p id...

Finding difficulty trying to get the jsTree plugin to initialize in a closed state

javascript,jquery,jstree
Afternoon Everyone. We're setting up a permissions tree for user profiles.We use the jsTree plugin found here: jQuery jsTree Plugin Over version is: 3.1.0Their current version is: 3.1.0 Here's our usage: /* Initialize any jsTress passed in. */ $( "." + section + "-panel-" + panel ).find( "div[class*='jstree']" ).each(function(){ $(this).jstree(...

add root node and make it editable

jquery,jstree
I use jsTree plugin to get a tree structure. I have a button that should add root node to the tree. I am able to add it but not edit it. As soon as i add it, it should be editable (the same way it happens while creating nodes from...

jsTree: bind keypress event on a newly created node

jstree,addeventlistener,onkeypress
I am trying to bind keypress event on a newly created node from context menu of jsTree. It seems adding listener for each and every node is not so good idea..Edited as per suggestion based on comments provided below $(function () { $('#demo').jstree({ ... "contextmenu":{ "items": function($node) { var tree...

jstree - one tree in different pages

javascript,jquery,jstree
i have a short question for the jstree (jstree.com) I would use one instance of the tree in different pages an save the current tree status with the "stage property" For example. I have the follow pages which have there own content. index.htm example1.htm example2.htm impressum.htm Now i would build...

jstree with default cheked attribute and find node by mask

jstree
I recently integrated jstree into my site, but the problem is that, I have no idea how to give jstree node element checked attribute by default, something like Jstree - precheck checkboxes is not my case. Something like data-jstree='{"selected":true}' is working but I don't want element to be just selected....

Populate jstree parent nodes dynamically

jquery,jstree
I have a jstree in which I need to populate the data dynamically..In the code below I'm trying to populate the parent nodes dynamically.. function populateJsTree(response) { for (i = 0; i < response.length; i++) { //this has list of parent nodes//eg:Parent1,Parent2,etc., var parent = response[i]; alert(parent.ParentNodeName); // successfully getting...

JQuery JsTree: jstree is not rendering properly in browser

javascript,jquery,html,css,jstree
I am working on a Jstree with context menu plugin but there are few issues. This is how my tree is getting rendered in browser(tested in both chrome as well as mozilla). but I want my jstree to be like this http://jsfiddle.net/govi20/cnbsfkx8/1/ There is not a single error on chromeDev...

How can I redraw my jstree with new HTML data?

javascript,jstree
I have a list of category depending of the publication selected. I want to redraw my category tree depending of the publication selected. I retrieve new html from the server everytime I select a new publication. My HTML look like that : <ul> <li id="27"> Moto <ul> <li id="30">Route</li> </ul>...

jstree: Cannot find element via an attribute

jquery,jstree
I'm trying to select a node according a attribute I have created (db-id) however I have tested with many option and still I don't get the node. Even trying to get the node via the "id" of the tag "li", it doesn't work yet. $(document).ready(function(){ $('#jstree').jstree(); $('#jstree').on('ready.jstree', function (e, data)...

Getting Check IDs from JSTree - Get_Checked finds the nodes but not the ids

javascript,jstree
Apologies if this has been asked and answered before. I've found a lot of posts that seem to answer the question but none of the solutions are working for me and I can't figure out why. I'm using a JSTree (version 3) and have updated it to the latest version....

jsTree customize
  • using the alternative JSON format along with AJAX
  • jstree
    I am using the alternative JSON format along with AJAX to load data in tree. Now there is a new ask, I am required to add a new element at the end of <li> tag. I have created sample URL to display what I am currently doing. Tree crated using...

    jstree: jquery.find working just for nodes of the first level

    jquery,jstree
    Why does this code not work? http://jsfiddle.net/3q9Ma/28/ <div id="jstree"> <ul> <li id="x1">AAA004 <ul> <li id="x2">AAA005</li> <li>AAA006 <ul> <li id="x3">AAA007 <ul> <li>AAA008</li> <li>AAA009</li> </ul> </li> <li>AAA010</li> </ul> </li> </ul> </li> <li>AAA011</li> <li>AAA012</li> </ul> </div> and the javascript: $(function () { $('#jstree').on('ready.jstree',...

    Efficient function for creating JSON data from File Directory Structure?

    javascript,jquery,arrays,json,jstree
    Like the title says, I have a directory structure, I want to convert it into a JSON format compatible for jsTree usage. So the output for a given list INPUT: ./Simple Root Node ./Root Node 2 ./Root Node 2/Child 1 ./Root Node 2/Child 2 OUTPUT: treeJSON = [ { "id"...

    Can't remove element from jsTree in IE

    javascript,jquery,jstree
    I have a customized jsTree in a html page. When the user clicks a .delete icon in the jsTree, I redirect the user to the same page, with a query string of "delete", and then I execute the logic to remove that user from that listing (maybe some ajax here...

    Dynamically resizing the width of a div that contains Jstree Tree

    jquery,css,jstree
    I've got the following layout: <div id="tree" class="jstree"></div> And it generates a jstree that has multiple levels of ul and li elements. I've got overflow:auto set so that as I expand or collapse the items, scrollbars appears. What I would like to happen is dynamically resize the width of #tree...

    jstree custom node markup

    javascript,jstree
    Is there a way to have custom markup or add additional html elements to some of the nodes. For example, we want to add an arrow (link) right after the node text for all the nodes under a path, and when user click on the arrow, open the context menu....

    How to make jstree empty on initialization?

    javascript,jquery,jstree
    On click of a button I send some key to controllerand get my lists using json , the array inside my lists acts as my children in my jstree, $("#btnSearch").on("click", function () { alert("I'm also here"); $.ajax({ type: "POST", url: "/Claims/JSTree", success: function (response) { var clients = []; var...

    jsTree addClass isn't remembered in some instances

    javascript,jquery,jstree,jstree-dnd
    Using jsTree and the drag and drop plugin, I'm trying to illustrate when a node's position has been changed. Using the move_node.jstree event, I add a class of isChanged to the node that is moved and this works fine. However, if I move a node that is a sibling of...