jstree

How can I rename a jsTree node

会有一股神秘感。 提交于 2019-12-03 23:16:48
I am not talking about $("#demo1").jstree("rename",node) which makes the node editable for the user. I am talking about the name being changed within the code. For example my nodes are all prefixed with a 2 digit number "[01]" so before I call $("#demo1").jstree("rename",node) I want to strip out the prefix, and put it back in once the user has finished editing. I have tried selecting "#nodeid a" but inside the hyperlink there is an ins tag and this gets replaced if i replace the URL contents. The documentation hasn't been helpful and I havent had much luck looking through the libraries code,

parameters of jstree create_node

邮差的信 提交于 2019-12-03 22:55:56
Could you please give me the list of parameters of this function and an example of usage $('#treepanel').jstree("create_node"); olafure IMHO jsTree is powerful, but documentation could be improved. The create_node function is documented here . Be careful not interpreting the [] as a literal. They are just to indicate that the parameters are optional. This works for jsTree version "pre 1.0 fixed": var position = 'inside'; var parent = $('#your-tree').jstree('get_selected'); var newNode = { state: "open", data: "New nooooode!" }; $('#your-tree').jstree( "create_node", parent, position, newNode,

in IE8 using jQuery JSTree when scrolling the click handlers don't work anymore

限于喜欢 提交于 2019-12-03 21:39:30
I'm using JStree to create a basic tree. In every browser this opens, closes,... fine except in IE8. I narrowed the problem down to this: When I don't scroll the page and the tree is positioned at the top of the page all clicks work fine. When I have scrolled the page (eg 20px) and then try to open the tree this doesn't work. The weird thing is that if I click 20px above the arrow to open the tree this works. The amount of pixels I need to click above the actual arrow depends on how much I've scrolled on the page. I guess this has something to do with the positioning of some elements but I can

How to add jstree to angular 2 application using typescript with @types/jstree

99封情书 提交于 2019-12-03 19:17:05
问题 Hi I believe it's some kind of a newbee question, but I'm new to ng2 so please bear with me... I've done: npm i jstree --save After I created using angular-cli application. Then I installed: npm i @types/jstree --save-dev And that's on setup, then I tried to use it and no luck. Please can someone show me how to use that 3rd party library with typescript 回答1: Here are the steps I took to get it to work. I started with a new cli application. npm install --save jquery jstree npm install --save

Jquery Jstree checkbox events capture

蓝咒 提交于 2019-12-03 16:40:52
问题 I am totally new to jQuery and jstree. I am using jstree and populating the data using xml. But would like to capture event for each node whether checked or not along with their Ids. I tried using jstree's plugins API like change_state() , check_node() or select_node() but it's not working. Also I would like to get all selected nodes data in an array for further processing..Can anyone help? Thanks... 回答1: I like the jstree plugin but it's not well documented, nor is it built to conform to say

jsTree how to change ajax url and reload data

别等时光非礼了梦想. 提交于 2019-12-03 16:04:09
$('#jstree_demo_div2').jstree({ 'core': { 'data': { "url": "tree.ashx?id=" + _id, "dataType": "json" // needed only if you do not supply JSON headers } }, "checkbox": { 'visible': true, 'keep_selected_style': false, }, "plugins": ["wholerow", "checkbox"] }); I need to change the url (or the variable _id will change) and then refresh data. But there seems to have a cache problem. I monitored the HTTP request, the request param _id didn't change. I've tried 'core': { 'data': { "url": "tree.ashx?id=" + _id, "cache":false, //←←←← "dataType": "json" // needed only if you do not supply JSON headers

jstree remove default elements from context menu

北战南征 提交于 2019-12-03 15:29:45
问题 I have a problem with JsTree's contextmenu, how can I remove the default elements from the contextmenu like Create, Delete, Rename? I want to provide elements of my own, but the default elements are still at the contextmenu. "contextmenu" : { "items" : { "IsimVer" : { "label" : "İsim Değiştir", "action" : function (obj) { this.rename(obj); } }, "Ekle" : { "label" : "Ekle", "action" : function (obj) { this.create(obj); } }, "Sil" : { "label" : "Sil", "action" : function (obj) { this.remove(obj

jsTree - rendering optimization | very long rendering with 2000 nodes

南楼画角 提交于 2019-12-03 13:45:41
I'm using jsTree ( 1.0-rc3 ) with option to load data by AJAX and I have a problem with loading about ~2000 childs node by it. While server responds within several seconds, it takes jsTree about ~40 seconds only to render the results in the browser (chrome, FF). In addition to that, FF returns information about no response from 'jquery-1.7.2.min.js'.The same amount of data freezes IE. Is it overloaded with data ? Or is it some kind of bug ? Are there any changeable factors, that can help me with faster rendering ? jQuery( "#dependency-tree" ).jstree( { 'plugins':['themes', 'json_data', 'ui',

How can I tell if jsTree has fully loaded?

荒凉一梦 提交于 2019-12-03 11:04:02
问题 I am trying to write a function that opens specific nodes on a jsTree but I am having a problem where the function is executed before my base tree is loaded from the ajax call. How can I tell if my jstree data has been loaded and wait until it is done loading. Below is the function I am trying to use. function openNodes(tree, nodes) { for (i in nodes) { $('#navigation').jstree("open_node", $(nodes[i])); } } I am loading my initial tree with the following command $("#navigation").jstree({

jstree move, drag and drop

自古美人都是妖i 提交于 2019-12-03 09:10:33
问题 I want to implement the move functionality for a node in jstree. Is it the move that needs to be implemented or the drag and drop? Alos, it will be nice to have a working code from binding the container to event and the event code. 回答1: You only need to use the dnd plugin if you don't need to enforce any move rules(don't allow certain nodes to be moved to other nodes etc) If you need to enforce move rules, you can add the crrm plugin. See the Reorder only demo of the dnd pluign documentation