1、页面
<t:datagrid name="decOrderList" checkbox="true" fitColumns="true" title="业务订单表" sortName="createDate" actionUrl="decOrderController.do?datagrid3" pagination="true" idField="id" fit="true" queryMode="group">
添加 pagination="true"
2、后台
@RequestMapping(params = "datagrid3")
public void datagrid3(LdcOrderTaxEntity decOrder,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
String invoiceno = request.getParameter("invoiceno");
String wheresql = "";
if(!"".equals(invoiceno)&&invoiceno!=null){
wheresql = " and invoiceno = '"+invoiceno+"'";
}
String hql = "from LdcOrderTaxEntity where 1=1 " +wheresql;
List<LdcOrderTaxEntity> ldcOrdertaxList = decOrderService.findHql(hql);
dataGrid.setResults(ldcOrdertaxList);
if(decOrderList.size()>0 ) {
dataGrid.setTotal(decOrderList.size());
}else{
dataGrid.setTotal(0);
}
TagUtil.datagrid(response, dataGrid);
}
添加
if(decOrderList.size()>0 ) {
dataGrid.setTotal(decOrderList.size());
}else{
dataGrid.setTotal(0);
}