时间:2021-07-10 09:32:50 | 栏目:jquery | 点击:次
在学习jquery easyui的tree组件的时候,在url为链接地址的时,发现如果最后一个节点的state为closed时,未节点显示为文件夹,单击会重新加载动态(Url:链接地址)形成无限循环。如:
tree.json
[{ "id":1, "text":"Folder1", "iconCls":"icon-save", "children":[{ "text":"File1", "checked":true },{ "text":"Books", "state":"open", "attributes":{ "url":"/demo/book/abc", "price":100 }, "children":[{ "text":"PhotoShop", "checked":true, "state":"closed" },{ "id": 8, "text":"Sub Bookds", "state":"open" }] }] }] $('#box').tree({ url :"tree.json", cascadeCheck : false, onlyLeafCheck : true, lines : true, formatter : function (node) { return '[' + node.text + ']'; } });
tree组件无限循环截图
解决方法:把末节点State状态设为open可正常显示
总结