f分页问题

$(function() {

function renderTable(jsonRes){
var productList = jsonRes.pageList;
var tbodyArray = [];

$('#listBody').html('');
if(null != productList && productList){
$.each(productList, function (index, item) {
tbodyArray.push('<tr>');
tbodyArray.push('<td>' + item.merchantName + '</td>');
tbodyArray.push('<td>' + item.merchantProName + '</td>');
tbodyArray.push('<td>' + item.projectName + '</td>');
tbodyArray.push('<td>' + item.pafProName + '</td>');
tbodyArray.push("<td><a href='" + "/admin/executeprocess/updateExecuteProcess/" + item.exeProcessId + "'>编辑</a></td>");
tbodyArray.push('</tr>');
});
$('#listBody').append(tbodyArray.join(''));
}
var totalpage=jsonRes.totalPage;
// 渲染分页插件
renderPage(jsonRes.currentPage, totalpage);
}

function renderPage(currentPage, maxPage){
$('.pagination').jqPagination('destroy');
$('.pagination').jqPagination({
page_string : '{current_page} / {max_page}',
current_page : currentPage,
max_page : maxPage,
paged: function(page) {
       // do something with the page variable
/* var projectName=$("#projectName").val();
    console.log(projectName+"a12312");*/
    var jsonReq = {"bgPage" : page, "pageSize" : 10, "projectName" : projectName};
    queryExecuteProcessList(jsonReq);
   }
});
}

function queryExecuteProcessList(jsonReq){
$.ajax({
type : 'POST',
url : '/admin/executeprocess/queryExecuteProcessList',
data : JSON.stringify(jsonReq),
dataType : 'json',
contentType : "application/json",
success : function(data) {
if ('000000' == data.resultCode) {
//渲染表格
renderTable(data);
} else {
EPU.util.layerDialog(data.resultCode,
data.resultMsg);
}
}
});
}

//分页函数
$('.pagination').jqPagination({
/*page_string : '{current_page} / {max_page}',
   paged: function(page) {
       // do something with the page variable
    var projectName=$("#projectName").value;
    console.log(projectName+"12312");
    var jsonReq = {"bgPage" : page, "pageSize" : 10};
    queryExecuteProcessList(jsonReq);
   }*/
});

// executeprocess
$('#add').click(function() {
window.location.href = '/admin/executeprocess/addExecuteProcess';
});


$('#search').click(
function() {
/*var projectName=$("#projectName").val();
    console.log(projectName+"a12312");*/
var jsonData = $('#formId').serializeObject();
queryExecuteProcessList(jsonData);
// stop the form from submitting and refreshing
event.preventDefault();
});

function initTable(){
var jsonReq = {"bgPage" : 1, "pageSize" : 10};
queryExecuteProcessList(jsonReq);
}

function init(){
initTable();
}

init();
});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值