|
发表于 2015-11-23 14:05:50
|
显示全部楼层
- //------------------jeecg 标签列表,扩展字段显示----------------
- List<GzUserInfoYw> gzUserInfoList = dataGrid.getResults();
- for(GzUserInfoYw temp:gzUserInfoList){
- Map<String,Map<String,Object>> extMap = new HashMap<String, Map<String,Object>>();
- Map<String,Object> m = new HashMap<String, Object>();
- m.put("mobile", "手机号值");
- m.put("nicknameTxt", "昵称");
- extMap.put(temp.getId(), m);
- }
- TagUtil.datagrid(response, dataGrid,extMap);
- //------------------jeecg 标签列表,扩展字段显示----------------
复制代码- /**
- * 控件类型:easyui
- * 返回datagrid JSON数据
- * @param response
- * @param dataGrid
- * @param extMap 数据列表的扩展
- */
- public static void datagrid(HttpServletResponse response,DataGrid dg,Map<String,Map<String,Object>> extMap) {
- response.setContentType("application/json");
- response.setHeader("Cache-Control", "no-store");
- JSONObject object = TagUtil.getJson(dg);
- JSONArray r = object.getJSONArray("rows");
- for (Object object2 : r) {
- JSONObject o =(JSONObject) object2;
- o.putAll(extMap.get(o.get("id")));
- }
- try {
- PrintWriter pw=response.getWriter();
- pw.write(object.toString());
- pw.flush();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
复制代码 |
|