table.render({
elem: '#examTable'
,url:'/exam/getWelErrorExam'
,height: 330
,page: true //开启分页
,cellMinWidth: 80
,title: ''
,limit: 10
,size: 'sm' //小尺寸的表格
,id: 'idTest'
,cols: [[
{field:'content', width:410, title: '试题内容',align:'left'}
,{field:'examType',width:100, title: '题型',align:'center', sort: true}
,{title: '操作',width:120,toolbar: '#toolbarDemo',align:'center'}
]]
});
后台接收:
@RequestMapping(value="/getWelErrorExam")
public JSONObject getWelErrorExamList(int page,int limit){
List<Map<String,Object>> list = service.getWelErrorExamList(page,limit);
int count =service.getErrorExamListTotal();
obj.accumulate("code", 0);
obj.accumulate("msg", "success");
obj.accumulate("count",count);
obj.accumulate("data",list );
return obj;
}