* @return
* @throws Exception
*/
public ActionForward departmentTreeInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
Dto dto = new BaseDto();
String nodeid = request.getParameter("node");
dto.put("parentid", nodeid);
List deptList = g4Reader.queryForList("Demo.queryDeptItemsByDto4TreeGridDemo", dto);
Dto deptDto = new BaseDto();
for(int i = 0; i < deptList.size(); i++){
deptDto = (BaseDto)deptList.get(i);
if(deptDto.getAsString("leaf").equals(SystemConstants.LEAF_Y))
deptDto.put("leaf", new Boolean(true));
else
deptDto.put("leaf", new Boolean(false));
if(deptDto.getAsString("id").length() == 6)
deptDto.put("expanded", new Boolean(true));
}
String jsonString = JsonHelper.encodeObject2Json(deptList);
super.write(jsonString, response);
return mapping.findForward(null);
}