标签:des style blog color os io for cti
function save(){ var nodes = $(‘#funcSelectTree‘).tree(‘getChecked‘);//获取所有打勾的节点 var flag = false; var array = new Array(); for(var i in nodes){ var parents = $(‘#funcSelectTree‘).tree(‘getParent‘,nodes[i].target); array.push(nodes[i].id);//把节点的数字存在数组里面 while(parents != undefined){//递归的方法可以获取到任意层深度的父节点 for(var j in nodes){ if(parents.id==nodes[j].id){ flag = true; break; } } if(!flag){ array.push(parents.id); } parents = $(‘#funcSelectTree‘).tree(‘getParent‘,parents.target); } } array.push(1); var str = array.join(); alert(str) var role_id = $(‘#roleSelectCombobox‘).combobox(‘getValue‘); $.ajax({ type: "post", url:‘<%=path%>/role.do?method=saveFuncInfo&role_id=‘ + role_id +‘&nodes=‘ + str + ‘&createdate=<%=df.format(date)%>‘, success: function (data) { } }); }
EasyUI父节点(parent)处理方法,布布扣,bubuko.com
标签:des style blog color os io for cti
原文地址:http://www.cnblogs.com/wangder/p/3885128.html