jstree create_node的参数 [英] parameters of jstree create_node
问题描述
你能否告诉我这个功能的参数列表和使用示例
Could you please give me the list of parameters of this function and an example of usage
$('#treepanel').jstree("create_node");
推荐答案
恕我直言jsTree功能强大,但文档可以改进。
IMHO jsTree is powerful, but documentation could be improved.
create_node函数记录在案此处。
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.
这适用于jsTree版本pre 1.0 fixed:
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, false, false);
JSTree 3.3.5
JSTree 3.3.5
从他们的文档create_node功能中反向args'newNode'和'position'
From their docs "create_node" functionality has inverted args 'newNode' and 'position'
$('#your-tree').jstree("create_node", parent, newNode, position, false, false);
https://www.jstree.com/api/#/?f=create_node([par,% 20node,%20pos,%20callback,%20is_loaded])
这篇关于jstree create_node的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!