コード例 #1
0
 public String combox() {
   List<AssetsType> list = this.assetsTypeService.getAll();
   StringBuffer buff = new StringBuffer("[");
   for (AssetsType assetsType : list) {
     buff.append("['" + assetsType.getAssetsTypeId() + "','" + assetsType.getTypeName() + "'],");
   }
   if (list.size() > 0) {
     buff.deleteCharAt(buff.length() - 1);
   }
   buff.append("]");
   setJsonString(buff.toString());
   return "success";
 }
コード例 #2
0
 public String tree() {
   List<AssetsType> list = this.assetsTypeService.getAll();
   StringBuffer sb = new StringBuffer("[{id:'0',text:'资产类型',expanded:true,children:[");
   for (AssetsType type : list) {
     sb.append(
         "{id:'" + type.getAssetsTypeId() + "',text:'" + type.getTypeName() + "',leaf:true},");
   }
   if (list.size() > 0) {
     sb.deleteCharAt(sb.length() - 1);
   }
   sb.append("]}]");
   setJsonString(sb.toString());
   return "success";
 }