EasyUI Tree树组件无限循环的解决方法

在学习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可正常显示

总结

以上所述是小编给大家介绍的EasyUI Tree树组件无限循环的解决方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wyzzpx.html