当前位置:编程学习 > JAVA >>

Jquery实现Checkbox易做图联动

一、测试的数据(JSON格式,用存储过程生成的)
 
[javascript]  
[{"count":16,"list":[{"MenuID":3,"MenuName":"信息管理","MenuCode":"msg","MenuCount":2,"MenuList":[{"MenuID":4,"MenuName":"信息发布","MenuCode":"msg_publis"},{"MenuID":5,"MenuName":"信息列表","MenuCode":"msg_list"}]},{"MenuID":6,"MenuName":"会员管理","MenuCode":"user","MenuCount":1,"MenuList":[{"MenuID":7,"MenuName":"会员列表","MenuCode":"user_list"}]},{"MenuID":8,"MenuName":"积分管理","MenuCode":"jf","MenuCount":1,"MenuList":[{"MenuID":9,"MenuName":"积分类别","MenuCode":"jf_type"}]},{"MenuID":10,"MenuName":"发布管理","MenuCode":"ps","MenuCount":1,"MenuList":[{"MenuID":11,"MenuName":"标签管理","MenuCode":"ps_lable"}]},{"MenuID":13,"MenuName":"管理员管理","MenuCode":"admin","MenuCount":4,"MenuList":[{"MenuID":14,"MenuName":"管理员组","MenuCode":"admin_gp"},{"MenuID":15,"MenuName":"权限管理","MenuCode":"admin_rule"},{"MenuID":43,"MenuName":"管理员列表","MenuCode":"admin_list"},{"MenuID":45,"MenuName":"部门管理","MenuCode":"admin_bm"}]},{"MenuID":16,"MenuName":"商品管理","MenuCode":"sp","MenuCount":2,"MenuList":[{"MenuID":26,"MenuName":"商品列表","MenuCode":"sp_list"},{"MenuID":27,"MenuName":"商品类别","MenuCode":"sp_type"}]},{"MenuID":17,"MenuName":"活动管理","MenuCode":"hd","MenuCount":1,"MenuList":[{"MenuID":28,"MenuName":"活动列表","MenuCode":"hd_list"}]},{"MenuID":18,"MenuName":"支付管理","MenuCode":"pay","MenuCount":1,"MenuList":[{"MenuID":29,"MenuName":"支付接口管理","MenuCode":"pay_api"}]},{"MenuID":19,"MenuName":"短信管理","MenuCode":"sms","MenuCount":2,"MenuList":[{"MenuID":30,"MenuName":"短信发送","MenuCode":"sms_send"},{"MenuID":31,"MenuName":"短信列表","MenuCode":"sms_list"}]},{"MenuID":20,"MenuName":"代金券管理","MenuCode":"djq","MenuCount":2,"MenuList":[{"MenuID":32,"MenuName":"代金券发放","MenuCode":"djq_send"},{"MenuID":33,"MenuName":"代金券列表","MenuCode":"djq_list"}]},{"MenuID":21,"MenuName":"优惠券管理","MenuCode":"yhq","MenuCount":2,"MenuList":[{"MenuID":34,"MenuName":"优惠券发放","MenuCode":"yhq_send"},{"MenuID":35,"MenuName":"优惠券列表","MenuCode":"yhq_list"}]},{"MenuID":22,"MenuName":"现金券管理","MenuCode":"xjq","MenuCount":2,"MenuList":[{"MenuID":36,"MenuName":"现金券发放","MenuCode":"xjq_send"},{"MenuID":37,"MenuName":"现金券列表","MenuCode":"xjq_list"}]},{"MenuID":23,"MenuName":"物流管理","MenuCode":"wl","MenuCount":1,"MenuList":[{"MenuID":38,"MenuName":"物流公司管理","MenuCode":"wl_cmp"}]},{"MenuID":24,"MenuName":"订单管理","MenuCode":"order","MenuCount":1,"MenuList":[{"MenuID":39,"MenuName":"订单列表","MenuCode":"order_list"}]},{"MenuID":25,"MenuName":"店铺管理","MenuCode":"shop","MenuCount":1,"MenuList":[{"MenuID":40,"MenuName":"店铺列表","MenuCode":"shop_list"}]},{"MenuID":51,"MenuName":"网站设置","MenuCode":"site","MenuCount":2,"MenuList":[{"MenuID":42,"MenuName":"后台菜单管理","MenuCode":"site_menu"},{"MenuID":49,"MenuName":"网站信息设置","MenuCode":"site_cfg"}]}]}]  
 
二、ASPX页面代码
 
[html]  
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminRules.aspx.cs" Inherits="Manager_Admins_AdminRules" %>  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>权限管理</title>  
    <script type="text/javascript" src="../../Scripts/Jquery/jquery-1.6.2.js"></script>  
    <script type="text/javascript" src="js/AdminRules.js"></script>  
    <style type="text/css">  
        ul  
        {  
            list-style: none;  
            text-align: left;  
        }  
    </style>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div id="div_info">  
    </div>  
    <div id="div_content">  
    </div>  
    <div>  
        <input type="button" id="btn_save" value="保存" onclick="GetRules()" />  
        <input type="hidden" id="h_Rules" />  
    </div>  
    </form>  
</body>  
</html>  
三、AdminRules.js代码
 
[javascript]  
$(document).ready(function (e)  
{  
    var dd;  
    $.ajax({  
        type: "POST",  
        data: "g_cmd=get",  
&n
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,