• jquery ajax异步加载table的方法


    //显示详细信息
    function showInfo(actionId, type) {
        $.post("Sys_Ajax/Sys_EmployInfo.ashx", { "type": "select", "actionId": actionId, "type2": type }, function (data, status) {
            if (status == "success") {
                var employs = $.parseJSON(data);
     
                $("#EmoplyList").empty(); //清空列表
                var head = "<tr class='topTrStyle'><td>姓名</td><td>编号</td><td>归属公司</td><td>直属部门</td><td>职位</td><td>角色</td><td>操作一</td><td>操作二</td></tr>";
                $("#EmoplyList").append(head);
                //加载列表
                for (var i = 0; i < employs.length; i++) {
                    var tr = "<tr style='background-color: #E9F2F7; font-size: 10pt; height: 25px'>";
    //                tr += "<td><a href='Employ_Edit.aspx?type=show&actionId=" + employs[i].Id + "&actionId2=" + actionId + "&type2=" + type + "&showTitle=查看用户信息'>" + employs[i].Name + "</a></td>";
                    tr += "<td><a id='aInfo[" + i + "]' href='javascript: void(0)' onclick='javascript: editEmploy("show","" + employs[i].Id + "","" + actionId + "","" + type + "","查看用户信息");return false;'>" + employs[i].Name + "</a></td>";
                    tr += "<td>" + employs[i].Code + "</td>";
                    tr += "<td>" + employs[i].Corp + "</td>"
                    tr += "<td>" + employs[i].Dept + "</td>";
                    tr += "<td>" + employs[i].Post + "</td>";
                    tr += "<td>" + employs[i].Role + "</td>";
                    tr += "<td><a id='aDel[" + i + "]' href='javascript: void(0)' onclick='javascript: del(" + employs[i].Id + ");return false;'>删除</a></td>";
                    tr += "<td><a id='aEdit[" + i + "]' href='javascript: void(0)' onclick='javascript: editEmploy("edit","" + employs[i].Id + "","" + actionId + "","" + type + "","编辑用户信息");return false;'>编辑</a></td>";
                    tr += "</tr>";
     
                    $("#EmoplyList").append($(tr));
                } //end for employs
            } //end if status
        });    //end post
    } //end showInfo
  • 相关阅读:
    Codeforces Canda Cup 2016
    Codeforces Round #377(div 2)
    后缀数组专题
    Codeforces Round #375(div 2)
    Codeforces Round #374(div 2)
    [HDU5902]GCD is Funny(xjb搞)
    [HDU5904]LCIS(DP)
    HDU 1251统计难题
    POJ2104 K-TH NUMBER 传说中的主席树
    poj 3041
  • 原文地址:https://www.cnblogs.com/dekevin/p/4241789.html
Copyright © 2020-2023  润新知