0
我想在创建时设置节点的类型。这是我想要的:如何在创建时设置节点的类型?
$("#tree").jstree("create_node", parentId, {text: "mynode", id: "myid", type: "mytype"}, "last");
这不设置类型。我知道set_type
存在,但我想知道节点的创建是否可行。
我想在创建时设置节点的类型。这是我想要的:如何在创建时设置节点的类型?
$("#tree").jstree("create_node", parentId, {text: "mynode", id: "myid", type: "mytype"}, "last");
这不设置类型。我知道set_type
存在,但我想知道节点的创建是否可行。
你没有表现出你的树全的配置,所以请检查的几件事情:
types
插件作为"plugins": [ "types" ]
你应该配置types
例如像这样:
"types" : {
"tree" : {
"icon" : 'https://www.jstree.com/tree-icon.png'
},
"mytype" : {
"icon" : 'glyphicon glyphicon-leaf'
}
}
观看演示JS Fiddle
我相信这个答案,你还会发现你的解决方案:http://stackoverflow.com/questions/6341279/jstree-not-creating-节点的-一个特定类型的 – matan7890