日期:2014-05-20 浏览次数:20685 次
$(function(){
$('#tt').datagrid({
nowrap:false,
striped: false,
collapsible:false,
border:false,
url:'queryPageAction_draftTasks',//action方法
loadMsg:'数据装载中......',
pageList:[20,40,60,80],
sortName:'code',
sortOrder:'desc',
remoteSort:false,
columns:[[
{title:'填报人工号',field:'createId',width:'100',align:'center'},
{title:'单据号',field:'sequenceNumber',width:'220',align:'center'}
]],
pagination:true,
rownumbers:true
});
});
//属性名不要改,前台控件需要。dto类型可改
public class ReimPageDto {
private int total;//总条目数
private List<reimDto> rows;//分页号的dto对象,属性与前台columns中field的对应
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public List<reimDto> getRows() {
return rows;
}
public void setRows(List<reimDto> rows) {
this.rows = rows;
}
}
}
public class QueryPageAction{
private int rows;//前台控件传来的行数
private int page;//前台控件传来的页数
public String draftTasks(){
ReimPageDto pageDto = reimbursementService.queryBursementList(page,rows);
JSONObject jb = JSONObject.fromObject(pageDto);
String json = jb.toString();
WebUtilities.print(json);//输出json数据
return null;
}
}