我使用dategrid显示数据,前段时间没有问题的,但是现在出现这么一个问题。
刚开始初始化dategrid没有问题,json数据也没有问题。如图:
JSON数据也没有问题:
{"total":15,"rows":[{"date":null,"gender":"男","studentName":"夏明","remark":"","id":1,"age":15},{"date":null,"gender":"男","studentName":"刘兴","remark":"","id":2,"age":16},{"date":null,"gender":"女","studentName":"李小梅","remark":"","id":3,"age":15},{"date":null,"gender":"男","studentName":"李明明","remark":"","id":4,"age":17},{"date":null,"gender":"男","studentName":"洪笑天","remark":"","id":5,"age":18},{"date":null,"gender":"女","studentName":"刘莹莹","remark":"","id":6,"age":14},{"date":null,"gender":"女","studentName":"赵玉","remark":"","id":7,"age":15},{"date":null,"gender":"女","studentName":"赵薇","remark":"","id":8,"age":23},{"date":null,"gender":"男","studentName":"赵子龙","remark":"","id":9,"age":12},{"date":null,"gender":"男","studentName":"关羽","remark":"","id":10,"age":14}]}
但是当我点击下一页(图中红圆圈处),数据没有更新,显示第二页:
ACTION中部分代码:
public String getAllStudentInfo() throws Exception
{
List<StudentInfo> Studentlist = studentInfo_services.getAllStudentInfo(rows, page);
Map<String, Object> jsonMap = new HashMap<String, Object>();
jsonMap.put("total", studentInfo_services.getStudentTotal());//total键 存放总记录数,必须的
jsonMap.put("rows", Studentlist);//rows键 存放每页记录 list
result=JSONObject.fromObject(jsonMap);
return SUCCESS;
}
我查看了一下,当显示第一页时,都完全正常,result=JSONObject.fromObject(jsonMap);这句话能够正常执行,但是当点击下一页的时候,Studentlist 中的数据也是对的,但是result=JSONObject.fromObject(jsonMap);这句话就不执行了。自然JSON数据也没有了。不知道什么原因。那句话为什么有选择性的执行?前段时间还好好的。随着编写增删改查后,出现这种现象,无语了。
大神帮帮忙