jstree create_node的参数 [英] parameters of jstree create_node

查看:219
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆