小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

EasyUI實現(xiàn)異步加載Tree

 WindySky 2017-03-17
Html內(nèi)容:
  1. <fieldset style="height: 350px;">  
  2.     <ul id="taskTree" style="height:400px;width:250px;overflow: auto;"></ul>                      
  3. </fieldset>  

 

js內(nèi)容:

[javascript] view plain copy
print?
  1. $('#taskTree').tree({  
  2.     checkbox: false,  
  3.     url: url,  
  4.     animate:true,  
  5.     lines:true,  
  6.     onClick:function(node){  
  7.         alert(node.text);  
  8.     },  
  9.     onBeforeExpand:function(node,param){                         
  10.         $('#taskTree').tree('options').url = ctx + "/rims/rescue/loadRescueTaskTreeRootNodes.do?parentId="+node.id;                  
  11.     }  
  12. });  


后臺內(nèi)容:

  1. JsonArray tree = new JsonArray();  
  2. JsonArray childs = new JsonArray();  
  3.       
  4. for(DisaRescueTaskView tView:tasks){  
  5.     JsonObject node = new JsonObject();  
  6.     node.addProperty("id", tView.getId());  
  7.     node.addProperty("text", tView.getName());  
  8.     node.addProperty("state", "closed");  
  9.     node.addProperty("icon", getTreeIconByRescueTaskMsg(tView));  
  10.     childs.add(node);  
  11. }  
  12.   
  13. JsonObject root = new JsonObject();  
  14. root.addProperty("id", "root");  
  15. root.addProperty("text", "救援任務");  
  16. root.addProperty("icon", "icon-ok");  
  17. root.add("children", childs);  
  18.       
  19. tree.add(root);  
  1. this.printOut(tree.toString());  


注:當前節(jié)點的state屬性設置成:closed,則展開該節(jié)點時,會異步展開這個節(jié)點下的所有子節(jié)點。

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約