在學習jquery easyui的tree組件的時候,在url為鏈接地址的時,發(fā)現(xiàn)如果最后一個節(jié)點的state為closed時,未節(jié)點顯示為文件夾,單擊會重新加載動態(tài)(Url:鏈接地址)形成無限循環(huán)。如:
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組件無限循環(huán)截圖

解決方法:把末節(jié)點State狀態(tài)設為open可正常顯示
總結(jié)
以上所述是小編給大家介紹的EasyUI Tree樹組件無限循環(huán)的解決方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網(wǎng)網(wǎng)站的支持!
新聞熱點
疑難解答