如何使用jstree创建节点时使用自定义文件夹图标?
问题描述:
没问题创建一个使用jstree默认的自定义文件夹,例如,如何使用jstree创建节点时使用自定义文件夹图标?
$("#treeFile1").jstree({
"plugins" : ["themes","html_data","ui","crrm","types"],
"types" : {
"valid_children" : [ "none" ],
"types" : {
"rootNote" : {
"valid_children" : ["none"],
"icon" : { "image" : "/bk/tree/_demo/customFolder.png"}
},
}
});
的来试图与自定义文件夹中创建节点上面的代码开始后时。
这里是我的失败尝试:
$("#treeFile1").jstree("create", null, "outside", {"attr" : {"rel" : "rootNote"}});
注:没有错误消息从Firefox控制台中显示
答
不知道为什么,但除去valid_children属性和值后,就解决了这个问题。
$("#treeFile1").jstree({
"plugins" : ["themes","html_data","ui","crrm","types"],
"types" : {
"types" : {
"rootNote" : {
"icon" : { "image" : "/bk/tree/_demo/customFolder.png"}
},
}
});