spring mvc jquery esayui tree 使用备份
<script src="${ctx}/static/esayui/jquery.easyui.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $("#tt").tree({ url:'${ctx}/permission/getRegion', checkbox:true, method:'post', animate:true, cascadeCheck:true, //loadFilter:function(data,parent){ //return convert(data); //}, onClick:function(node){ alert(node.id+"-"+node.text); }, onBeforeExpand:function(node){ return true; }, onExpand:function(node){ var node = $('#tt').tree('find', '210'); $('#tt').tree('check', node.target); return true; } }); //转换服务器返回的json为tree数据源 function convert(rows){ var nodes = []; for(var i=0; i<rows.length; i++){ var row = rows[i]; nodes.push({ id:row.id, text:row.name, state:row.state }); } return nodes; } }); //获取已选择的节点 function getCheckedNoeds(){ var nodes = $('#tt').tree('getChecked'); var reNodes =[]; for (var i=0; i<nodes.length; i++){ node =nodes[i]; reNodes.push(node.id.toString()); } alert(typeof(reNodes)); return reNodes; } //设置节点状态为已选中状态 function setNodeChecked(){ var node = $('#tt').tree('find', '086'); alert(node.id+'--'+node.text); $('#tt').tree('check', node.target); } </script>
相关推荐
yupi0 2020-10-10
spring 2020-08-18
编程点滴 2020-07-29
幸运小侯子 2020-07-05
itjavashuai 2020-07-04
qingjiuquan 2020-06-29
shushan 2020-06-25
小鱿鱼 2020-06-22
咻pur慢 2020-06-18
melonjj 2020-06-17
qingjiuquan 2020-06-13
neweastsun 2020-06-05
小鱿鱼 2020-06-05
mxcsdn 2020-05-31
吾日五省我身 2020-05-27
牧场SZShepherd 2020-05-27
sweetgirl0 2020-05-14