zoukankan      html  css  js  c++  java
  • easyui中导航菜单accordion与tree的动态添加

     
    Js代码  收藏代码
    1. $.parser.parse();  
    2. $.ajax({  
    3.     url:my.bp()+'/main/menuaction!createMenu.action',  
    4.     type:'post',  
    5.     async: false,  
    6.     dataType:'json',  
    7.     success:function(data){  
    8.         $.each(data, function(i, item){  
    9.             $('#main_west_accordion').accordion('add',item);  
    10.             $('#'+item.id).html('<ul id="ctrltree'+item.id+'" style="margin-top: 5px;"></ul>');  
    11.             $('#ctrltree'+item.id).tree({  
    12.                 url:my.bp()+'/main/menuaction!treeMenu.action?id='+item.id,  
    13.             });  
    14.             $('#ctrltree'+item.id).tree({  
    15.                     onLoadSuccess:function(){  
    16.                     $(this).tree('options').url = my.bp()+'/main/menuaction!treeMenu.action';  
    17.                 },  
    18.                 onClick : function(node){  
    19.                     //add(tab)  
    20.                 //  console.info(node);  
    21.                 },  
    22.                 onDblClick : function(node){  
    23.                     if (node.state == 'closed'){  
    24.                         $(this).tree('expand', node.target);  
    25.                     }else{  
    26.                         $(this).tree('collapse', node.target);  
    27.                     }  
    28.                 }  
    29.             });  
    30.         });           
    31.     }  
    32. }); 
  • 相关阅读:
    每日日报63
    每日日报62
    每日日报61
    每日日报60
    每日日报59
    每日日报58
    el-table表格拖动排序
    vue/eslint
    $attrs $listeners
    table封装成全局组件
  • 原文地址:https://www.cnblogs.com/wdcwy/p/4996522.html
Copyright © 2011-2022 走看看