日期:2014-05-16 浏览次数:20792 次
$(function(){
var oTable = $('#datatable').dataTable({
'bJQueryUI': true,
"bProcessing":true,
"bServerSide": true,
"iDisplayStart":0,
"iDisplayLength": 5,
"sAjaxSource":"region_safe_home
_json.action?region.id=1",
"sAjaxDataProp":"applyInfoList",
"aoColumns": [
{ "mDataProp": "id" },
{ "mDataProp": "resource.resourceName" },
{ "mDataProp": "operateTypeName" },
{ "mDataProp": "applyUser" },
{ "mDataProp": "statusName" },
{ "mDataProp": "createTime"}
],
'sPaginationType': 'full_numbers',
'bSort':false,
});
});
private int curPage; private String iTotalRecords; //向前端返回数据需要的JSON对象 private String iTotalDisplayRecords;//向前端返回数据需要的JSON对象 private int iDisplayLength; private int iDisplayStart; public String applyHome() throws ServiceException{ return SUCCESS; } public String applyList() throws ServiceException{ int displayLength = iDisplayLength; int displayStart = iDisplayStart ; applyInfoList = this.getApplyInfoManager().findApplyInfoByRegion(region); int totalNum = applyInfoList.size(); int pageCount = totalNum/displayLength; int remainder = totalNum%displayLength; if(remainder != 0){ pageCount = pageCount + 1; } iTotalRecords = totalNum+""; iTotalDisplayRecords = totalNum+""; curPage = displayStart/displayLength+1; int startNum = displayStart; int endNum = 5; startNum = displayLength*(curPage-1); if(remainder != 0){ if(curPage == pageCount){ endNum = startNum + remainder; }else{ endNum = startNum+displayLength; } }else { endNum = startNum+displayLength; } applyInfoList = applyInfoList.subList(startNum, endNum); return SUCCESS; }?