ExtremeTable 数据库分页的写法

ExtremeTable 数据库分页的写法

< ec:table  items ="itemList"  var ="item"  action ="${pageContext.request.contextPath}/query.do"
retrieveRowsCallback
="limit"  
filterRowsCallback
="limit"
 
sortRowsCallback
="limit"
  >
 
< ec:exportXls  fileName ="CouponList.xls"  tooltip ="导出 Excel" />
< ec:row >
    
< ec:column  property ="rowcount"  cell ="rowCount"  sortable ="false"  title ="序号" />
    
< ec:column  property ="id"  title ="编号" />
    
< ec:column  property ="type"  title ="种类" >
          ${typeMap[item.type]}
    
</ ec:column >
    
< ec:column  property ="name"  title ="名称" />
    
< ec:column  property ="beginDate"  title ="开始时间"  cell ="calendar"  format ="date"   />
    
< ec:column  property ="endDate"  title ="结束时间"  cell ="calendar"  format ="date"   />
    
< ec:column  property ="state"  title ="状态" >
        ${statusmap[coupon.status]}
    
</ ec:column >
    
< ec:column  property ="edit"  title ="操作"  sortable ="false"  viewsAllowed ="html"
                       style
="width: 56px;text-align: center" >
                
< href ="<c:url value=" /security/user.do?method =selectRoles&userId=${user.id}"  /> ">  < img
                        
src ="<c:url value=" /images/icon/16x16/manage.gif" /> " border="0"/>  </ A >
            
</ ec:column >
        
</ ec:row >
    
</ ec:table >

其中:
      retrieveRowsCallback="limit"
     filterRowsCallback="limit"
     sortRowsCallback="limit"
指定了callback函数 limit

在controller 中的处理:
  /**
  * 列表查看
*/

protected   void  onList(HttpServletRequest request,HttpServletResponse response, ModelAndView mav)  throws  Exception  {
   Limit limit 
=  ExtremeTablePage.getLimit(request);
   Map map 
=  WebUtils.getParametersStartingWith(request,  " search_ " );
   Page page
= service.queryForPage(map,ExtremeTablePage.getSort(limit),limit.getPage(), limit.getCurrentRowsDisplayed());
   mav.addObject(
" itemList " , page.getResult());
   mav.addObject(
" totalRows " ,page.getTotalCount());
}

你可能感兴趣的:(ExtremeTable 数据库分页的写法)