|
楼主 |
发表于 2013-11-28 15:22:06
|
显示全部楼层
这个东西偶弄出来了.
1、首先在List界面加这些
<t:datagrid name="projectInfoList" title= '项目信息管理
<a id="state" style="cursor:pointer;" onclick="returnBase(0)" >新开</a>
<a style="cursor:pointer;" onclick="returnBase(1)">开工</a>
<a style="cursor:pointer;" onclick="returnBase(2)">在建</a>
<a style="cursor:pointer;" onclick="returnBase(3)">竣工</a>
<a style="cursor:pointer;" onclick="returnBase(4)">投产</a> actionUrl="projectInfoController.do?datagrid" idField="id" fit="true" checkbox="true">
2、然后写一个
function returnBase(id){
$('#projectInfoList').datagrid({
url:'projectInfoController.do?datagrid&auditState='+id,
pageNumber:1,
});
}
3、controller:
private DataGrid dataGrid1;
@RequestMapping(params = "datagrid")
public void datagrid(ProjectInfoEntity projectInfo,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
//新的dataGrid1赋值
if(dataGrid.getField() != null && !"".equals(dataGrid.getField())){
dataGrid1 = dataGrid;
}else{
dataGrid = dataGrid1;
}
CriteriaQuery cq = new CriteriaQuery(ProjectInfoEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, projectInfo, request.getParameterMap());
this.projectInfoService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid); |
|