- 注册时间
- 2013-10-23
- 最后登录
- 2013-11-20
- 阅读权限
- 10
- 积分
- 31
- 精华
- 0
- 帖子
- 8
|
初学这个miniui今天做了一个简单的grid,不知道怎么把后台查出我的数据总数设到前台显示,还有就是每次进action时控制台会报:There is no Action mapped for namespace /scripts/miniui/themes/default and action name 0.这个action不是我查询的请求路径,全局搜也没搜出来。我自己写的查询方法可以在前台显示出数据,只是每次进我的action之前会抛出上面那人错。
代码如下:
<div id="datagrid1" class="mini-datagrid" style="width:800px;height:280px;"
url="pages/emps/myemp_list.action" pageSize="5" totalCount="0" idField="empno" multiSelect="true"
>
<div property="columns">
<div type="indexcolumn"></div>
<div type="checkcolumn" ></div>
<div field="empno" width="120" headerAlign="center" allowSort="true">员工编号</div>
<div field="ename" width="120" headerAlign="center" allowSort="true">员工姓名</div>
<div field="job" width="120" headerAlign="center" allowSort="true">职位</div>
<div field="mgr" width="120" headerAlign="center" allowSort="true">领导</div>
<div field="hiredate" width="120" headerAlign="center" allowSort="true">雇佣日期</div>
<div field="sal" width="120" headerAlign="center" allowSort="true">工资</div>
<div field="comm" width="120" headerAlign="center" allowSort="true">奖金</div>
<div field="deptno" width="120" headerAlign="center" allowSort="true">所属部门</div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load({'ename' : mini.get("key").value},function(){
});
</script>
后台代码:
public String list() throws Exception {
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
if(StringUtil.isNotBlank(request.getParameter("pageIndex")) && !request.getParameter("pageIndex").equals("0")){
cp = Integer.parseInt(request.getParameter("pageIndex"));
}
if(StringUtil.isNotBlank(request.getParameter("pageSize"))){
ls = Integer.parseInt(request.getParameter("pageSize"));
}
Map<String,Object> map = myempSerivce.findAll(colunm, keyWord,cp , ls);
list = (List<MyEmp>) map.get("emps");
request.setAttribute("totalCount", map.get("count"));
response.getWriter().write(JsonUtil.getJson(list));
return null;
}
|
|