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=http://www.likecs.com/\'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=http://www.likecs.com/\'background-color: #E9F2F7; font-size: 10pt; height: 25px\'>"; // tr += "<td><a href=http://www.likecs.com/\'Employ_Edit.aspx?type=show&actionId=" + employs[i].Id + "&actionId2=" + actionId + "&type2=" + type + "&showTitle=查看用户信息\'>" + employs[i].Name + "</a></td>"; tr += "<td><a id=http://www.likecs.com/\'aInfo[" + i + "]\' href=http://www.likecs.com/\'javascript: void(0)\' onclick=http://www.likecs.com/\'javascript: editEmploy(\"show\",\"" + employs[i].Id + "http://www.likecs.com/\",\"" + actionId + "http://www.likecs.com/\",\"" + type + "http://www.likecs.com/\",\"查看用户信息\");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=http://www.likecs.com/\'aDel[" + i + "]\' href=http://www.likecs.com/\'javascript: void(0)\' onclick=http://www.likecs.com/\'javascript: del(" + employs[i].Id + ");return false;\'>删除</a></td>"; tr += "<td><a id=http://www.likecs.com/\'aEdit[" + i + "]\' href=http://www.likecs.com/\'javascript: void(0)\' onclick=http://www.likecs.com/\'javascript: editEmploy(\"edit\",\"" + employs[i].Id + "http://www.likecs.com/\",\"" + actionId + "http://www.likecs.com/\",\"" + type + "http://www.likecs.com/\",\"编辑用户信息\");return false;\'>编辑</a></td>"; tr += "</tr>"; $("#EmoplyList").append($(tr)); } //end for employs } //end if status }); //end post } //end showInfo

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzywdd.html