如题,比如我点击下一页的时候,下一页的复选框都选中!!,改如何实现
onLoadSuccess中调用checkAll方法全选就行了
static Logger log = Logger.getLogger(StudentAction.class);
private JSONObject jsonObj;
private String rows;// 每页显示的记录数
private String page;// 当前第几页
private StudentService student_services;//String依赖注入
//查询出所有学生信息
public String getAllStudent() throws Exception {
log.info("查询出所有学生信息");
List list = student_services.getStudentList(page, rows);
this.toBeJson(list,student_services.getStudentTotal());
return null;
}
//转化为Json格式
public void toBeJson(List list,int total) throws Exception{
HttpServletResponse response = ServletActionContext.getResponse();
HttpServletRequest request = ServletActionContext.getRequest();
JSONObject jobj = new JSONObject();//new一个JSON
jobj.accumulate("total",total );//total代表一共有多少数据
jobj.accumulate("rows", list);//row是代表显示的页的数据
response.setCharacterEncoding("utf-8");//指定为utf-8
response.getWriter().write(jobj.toString());//转化为JSOn格式
log.info(jobj.toString());
}
可以参考:http://blog.csdn.net/sbvfhp/article/details/9175575
static Logger log = Logger.getLogger(StudentAction.class);
private JSONObject jsonObj;
private String rows;// 每页显示的记录数
private String page;// 当前第几页
private StudentService student_services;//String依赖注入
//查询出所有学生信息
public String getAllStudent() throws Exception {
log.info("查询出所有学生信息");
List list = student_services.getStudentList(page, rows);
this.toBeJson(list,student_services.getStudentTotal());
return null;
}
//转化为Json格式
public void toBeJson(List list,int total) throws Exception{
HttpServletResponse response = ServletActionContext.getResponse();
HttpServletRequest request = ServletActionContext.getRequest();
JSONObject jobj = new JSONObject();//new一个JSON
jobj.accumulate("total",total );//total代表一共有多少数据
jobj.accumulate("rows", list);//row是代表显示的页的数据
response.setCharacterEncoding("utf-8");//指定为utf-8
response.getWriter().write(jobj.toString());//转化为JSOn格式
log.info(jobj.toString());
}
可以参考:http://blog.csdn.net/sbvfhp/article/details/9175575
这种需求真无语,不如什么都不做,让用户自己点击全选按钮