JSTREE 1.0创建新类型



我正在尝试使用Jstree。

实际上我正在使用以下示例:php&您可以在网页上找到的MySQL演示 事件订单:http://www.jstree.com/demo

我需要在树结构中创建一个新类型,因此我在第059行中添加了以下代码行(以引用链接中可以看到的示例)

 "mytype" : { "valid_children" : "none", "icon" : { "image" :
 "./mytype.png" } },

然后在按钮的代码菜单中我还将其添加到MMENU输入单击函数:

case "add_mynewtype":
    $("#demo").jstree("create", null, "last", { "attr" : { "rel" : "mytype" } });
    break; 

显然我还连接了一个新的输入按钮:

<input type="button" id="add_mynewtype" value="Create new type" style="display:block; float:left;"/>

,但这无法正常工作....

有人可以帮助我吗?非常感谢您,任何提示都非常感谢

我找到了我问题的解决方案。

有必要修改文件夹声明,如下:

"folder" : {
            "valid_children" : [ "default", "folder", "mytype" ],
            "icon" : {"image" : "./folder.png" }
        },

或:

"folder" : {
            "valid_children" : [ "all" ],
            "icon" : {"image" : "./folder.png" }
        },

最新更新