Excel自选导出功能实现
//导出function ExportXls() {
var rows = $("#eflChukuList").datagrid('getSelections');
if (rows.length<=0) {
tip('请选择导出项目');
return;
}
var ids = "";
if (rows.length > 0) {
for ( var i = 0; i < rows.length; i++) {
ids=ids+","+rows.id;
}
}
JeecgExcelExport("eflChukuController.do?exportXls&type=overdue&ids="+ids,"eflChukuList");
}
以上是前端JS代码实现将选中ID传进后台,这个可以做很多事情。一下是后端代码
//获取表头id
String ids = request.getParameter("ids");
if(ids.length()>=1){
ids =ids.substring(1,ids.length());
}
String[] idsArray = ids.split(",");
CriteriaQuery cq = new CriteriaQuery(EflChukuEntity.class, dataGrid);
//查询条件组装器
cq.in("id", idsArray);
后台具体怎么写呢,
页:
[1]