function InitData(pageindx) {
var tbody = "";
$.ajax({
type: "post", //用POST方式传输
dataType: "json", //数据格式:JSON
url: 'JiaoshiList.aspx', //目标地址
data: "do=page&p=" + (pageindx + 1) + "&condition=" + condition + "&orderby=" + orderby,
success: function (json) {
//绑定表格数据
$('#productTable>tbody>tr').remove();
if (json.pageCount == 0) {
$("#Pagination").html('提示: 查询结果不存在,请核对您的查询条件!');
condition = "";
return false;
}
var classpage=json.Classpage;
$.each(classpage,function(i,n){
var trs="";
trs += "<tr><td class='alignM'>" + i + "</td><td class='alignM'>" + n.roommc + "</td><td>" + n.roomtype + "</td><td class='alignM'>"+ n.roomrl +" </td><td class='alignM'>"+ n.roomksrl +" </td><td class='alignM'>"+ n.b_z +" </td><td class='alignM'>"+ n.e_z +" </td><td class='alignM'><a href='#' alt='" + n.id
+ "' class='edit'>编辑</a> </td><td class='alignM'><a href='#' alt='" + n.id + "' class='delete'>删除</a></td></tr>";
tbody += trs;
});
$("#productTable").append(tbody);
//分页设置信息
$("#Pagination").pagination(json.pageCount, {
callback: pageselectCallback,
prev_text: '? 上一页',
next_text: '下一页 ?',
items_per_page: 15,
num_display_entries: 6,
current_page: pageindx,
num_edge_entries: 2
});
$("#productTable>tbody>tr:odd").addClass("oddColor");
$('#productTable>tbody>tr').hover(
function () { $(this).addClass("overColor") },
function () { $(this).removeClass("overColor") }
)
}
});
}
|