我在下面有以下代码,单击 add_file ($("#treeFile").jstree("create")); 时需要在 jstree 文件结构中添加一个 file.png 图标。
$("#treeFile").jstree({
"plugins" : ["themes","html_data","ui","crrm","types"],
"types" : {
"max_depth" : -2,
"max_children" : -2,
"valid_children" : [ "drive" ],
"types" : {
"default" : {
"valid_children" : "none",
"icon" : { "image" : "/tree/_demo/file.png"}
}
}
}
})
.bind("select_node.jstree", function (event, data) {
});
$("#treeMenu li").click(function()
{
if($(this).text() == "add_file")
{
$("#treeFile").jstree("create");
}else if($(this).text() == "add_folder")
{
$("#treeFile").jstree("create");
}else if($(this).text() == "rename")
{
$("#treeFile").jstree("rename");
}else if($(this).text() == "remove")
{
$("#rootNode").jstree("remove");
}else
{}