這篇文章主要介紹了EasyUi combotree 實(shí)現(xiàn)動態(tài)加載樹節(jié)點(diǎn)的相關(guān)資料,需要的朋友可以參考下
easyui 1.2.4例子中并沒有給出動態(tài)加載樹節(jié)點(diǎn)的例子,只好自己研究。
從源碼中可知可以看出combotree 是繼承 combo 和 tree兩個控件,所以在展開其下級子節(jié)點(diǎn)時,把combotree內(nèi)置的tree的options選項(xiàng)的url重置成一個動態(tài)取選擇值的url,代碼如下:
代碼如下:
$('#cc').combotree({
url:"treejson.aspx?act=allregion&parentid=0",
onBeforeExpand:function(node){
$('#cc').combotree("tree").tree("options").url= "treejson.aspx?act=allregion&parentid=" + node.id;
}
});
以上內(nèi)容是小編給大家介紹的EasyUi combotree 實(shí)現(xiàn)動態(tài)加載樹節(jié)點(diǎn)的相關(guān)知識,希望對大家有所幫助!