jquery +json +html 怎么做分页
1个回答
2016-09-29
展开全部
$(document).ready(function () {
$.getJSON("list.ashx", function (data) {
$.each(data.TableInfo, function (i, item) {
$("#tbody").append("<tr target=\"sid_user\" rel=" + item.id + "><td><input name=\"ids\" value=" + item.id + " type=\"checkbox\"></td><td>" + item.id + "</td><td>" + item.name + "</td></tr>");
});
});
});
<table class="table" width="1200" layoutH="138">
<thead>
<tr>
<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
<th width="120" orderField="accountNo" class="asc">客户号</th>
<th orderField="accountName">客户名称</th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
$.getJSON("list.ashx", function (data) {
$.each(data.TableInfo, function (i, item) {
$("#tbody").append("<tr target=\"sid_user\" rel=" + item.id + "><td><input name=\"ids\" value=" + item.id + " type=\"checkbox\"></td><td>" + item.id + "</td><td>" + item.name + "</td></tr>");
});
});
});
<table class="table" width="1200" layoutH="138">
<thead>
<tr>
<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
<th width="120" orderField="accountNo" class="asc">客户号</th>
<th orderField="accountName">客户名称</th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询