jQuery MiniUI

标题: 关于加载grid数据问题(strut1) [打印本页]

作者: ou7705312    时间: 2013-12-21 20:57:04     标题: 关于加载grid数据问题(strut1)


js代码
// 显示工单Win
  function showOrderWin() {
   var orderWin = mini.get("orderWin");
   // 初始化工单Grid
   var ordergrid = mini.get("ordergrid");
   var data2 = mini.decode(data);
   ordergrid.setData(data2 );
   ordergrid.load();
   // 显示工单Win
   orderWin.show();
  }

后台Struts1返回json数据方法
  
   public ActionForward queryOrder(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request,
      HttpServletResponse response) throws IOException {
  try {
   PageModel pm = orderService.queryOrder();
    orderList = pm.getList(); //这里都能有数据
   total = pm.getTotalRecords();
   net.sf.json.JSONObject jsonObj = new net.sf.json.JSONObject();
   net.sf.json.JSONArray jsonArray = net.sf.json.JSONArray.fromObject(orderList);  /
            jsonObj.put("total", orderList.size());
            jsonObj.put("data", jsonArray);
      response.getWriter().print(jsonObj.toString());
      response.getWriter().flush();
            response.getWriter().close();
  } catch (Exception e) {
   logger.error(e.getMessage());
  }
  return null;
}


页面js也没报错,窗口中表单就是没有数据,这是什么原因?(我是一个miniui的初学者,还请各位大神赐教,多谢!)

作者: factory    时间: 2013-12-23 10:01:41

你后台的数据有没有成功返回到了前台?




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2