1.comboTree控件

1.页面方法:

<t:comboTree url="jeecgFormDemoController.do?getComboTreeData" value="402880e447e99cf10147e9a03b320003" name="depid" id="depid" width="200"></t:comboTree>

  2.controller方法:

  

    @RequestMapping(params = "getComboTreeData")
    @ResponseBody
    public List<ComboTree> getComboTreeData(HttpServletRequest request, ComboTree comboTree) {
        CriteriaQuery cq = new CriteriaQuery(TSDepart.class);
          if (comboTree.getId() != null) {
            cq.eq("TSPDepart.id", comboTree.getId());
                        }
          if (comboTree.getId() == null) {
            cq.isNull("TSPDepart");
                        }
              cq.add();
          List<TSDepart> demoList = systemService.getListByCriteriaQuery(cq, false);
          List<ComboTree> comboTrees = new ArrayList<ComboTree>();
          ComboTreeModel comboTreeModel = new ComboTreeModel("id", "departname", "TSDeparts");
              comboTrees = systemService.ComboTree(demoList, comboTreeModel, null, false);
                  return comboTrees;
                          }

2.ztree 控件

    1.页面方法:

        <t:selectZTree id="citySel" url="jeecgFormDemoController.do?getTreeData" windowWidth="400px"></t:selectZTree>

    2.controller层方法

        

@RequestMapping(params="getTreeData",method ={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public AjaxJson getTreeData(TSDepart depatr,HttpServletResponse response,HttpServletRequest request ){
AjaxJson j = new AjaxJson();
try{
List<TSDepart> depatrList = new ArrayList<TSDepart>();
StringBuffer hql = new StringBuffer(" from TSDepart t");
//hql.append(" and (parent.id is null or parent.id='')");
depatrList = this.systemService.findHql(hql.toString());
List<Map<String,Object>> dataList = new ArrayList<Map<String,Object>>();
Map<String,Object> map = null;
for (TSDepart tsdepart : depatrList) {
String sqls = null;
Object[] paramss = null;
map = new HashMap<String,Object>();
map.put("id", tsdepart.getId());
map.put("name", tsdepart.getDepartname());
if (tsdepart.getTSPDepart() != null) {
map.put("pId", tsdepart.getTSPDepart().getId());
map.put("open",false);
}else {
map.put("pId", "1");
map.put("open",false);
}
sqls = "select count(1) from t_s_depart t where t.parentdepartid = ?";
paramss = new Object[]{tsdepart.getId()};
long counts = this.systemService.getCountForJdbcParam(sqls, paramss);
if(counts>0){
dataList.add(map);
}else{
TSDepart de = this.systemService.get(TSDepart.class, tsdepart.getId());
if (de != null) {
map.put("id", de.getId());
map.put("name", de.getDepartname());
if(tsdepart.getTSPDepart()!=null){
map.put("pId", tsdepart.getTSPDepart().getId());
map.put("open",false);
}else{
map.put("pId", "1");
map.put("open",false);
}
dataList.add(map);
}else{
map.put("open",false);
dataList.add(map);
}
}
}
j.setObj(dataList);
}catch(Exception e){
e.printStackTrace();
}
return j;
}

 

        

          

        

        

        

      

          

      

            

jeecg中的树形控件demo的更多相关文章

  1. VC中的树形控件

    树形控件可以显示出各项之间的层次关系,因此在VC中很常用. 1.树形控件的常用风格 TVS_HASBUTTONS 在父项目前显示+.-.用户可以通过点击该符号来打开或收起子项 TVS_HASLINES ...

  2. vue中element-ui树形控件自定义节点,注意一下

    在项目中用到菜单项编辑删除,在 element-ui自定义节点内容时, 有说明:使用render-content指定渲染函数, 得环境支持 JSX 语法,只要正确地配置了相关依赖,就可以正常运行. 一 ...

  3. vue+element-ui之tree树形控件有关子节点和父节点之间的各种选中关系详解

    做后端管理系统,永远是最蛋疼.最复杂也最欠揍的事情,也永远是前端开发人员最苦逼.最无奈也最尿性的时刻.蛋疼的是需求变幻无穷,如同二师兄的三十六般变化:复杂的是开发难度寸步难行,如同蜀道难,难于上青天: ...

  4. Extjs树形控件入门

    Extjs树形控件由Ext.tree.TreePanel类定义,控件的名称为TreePanel,TreePanel继承自Panel类,在Extjs中使用树形控件其实很简单. 大家知道要使用Extjs必 ...

  5. Web应用程序开发,基于Ajax技术的JavaScript树形控件

    感谢http://www.cnblogs.com/dgrew/p/3181769.html#undefined 在Web应用程序开发领域,基于Ajax技术的JavaScript树形控件已经被广泛使用, ...

  6. js树形控件—zTree使用总结

    0 zTree简介 树形控件的使用是应用开发过程中必不可少的.zTree 是一个依靠 jQuery 实现的多功能 “树插件”.优异的性能.灵活的配置.多种功能的组合是 zTree 最大优点. 0.0 ...

  7. Qt树形控件QTreeView使用1——节点的添加删除操作 复选框的设置

    QtreeView是ui中最常用的控件,Qt中QTreeWidget比QTreeView更简单,但没有QTreeView那么灵活(QTreeWidget封装的和MFC的CTreeCtrl很类似,没有m ...

  8. Android 打造任意层级树形控件 考验你的数据结构和设计

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/40212367,本文出自:[张鸿洋的博客] 1.概述 大家在项目中或多或少的可能会 ...

  9. Android 打造任意层级树形控件 考验你的数据结构和设计

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/40212367,本文出自:[张鸿洋的博客] 1.概述 大家在项目中或多或少的可能会 ...

随机推荐

  1. 20145314郑凯杰《网络对抗技术》实验5 MSF基础应用

    20145314郑凯杰<网络对抗技术>实验5 MSF基础应用 1.0 MS08_067安全漏洞 1.1 实验目标 了解掌握metasploit平台的一些基本操作,能学会利用已知信息完成简单 ...

  2. LINUX实践--ELF分析

    一.ELF文件头(定义在/usr/include/elf.h)中 二.实践部分 第一行 对应e_ident[EI_NIDENT]:实际表示内容为7f45 4c46 0101 0100 0000 000 ...

  3. godaddy之ssl申请

    第一步 执行下面命令生成csr和key文件 openssl req -new -newkey rsa: -nodes -keyout trips.com.key -out trips.com.csr ...

  4. Thread.Start和Delegate.BeginInvoke 以及Control.BeginInvoke

    Thread.Start starts a new OS thread to execute the delegate. When the delegate returns, the thread i ...

  5. FW: How to use Hibernate Lazy Fetch and Eager Fetch Type – Spring Boot + MySQL

    原帖 https://grokonez.com/hibernate/use-hibernate-lazy-fetch-eager-fetch-type-spring-boot-mysql In the ...

  6. .net core部署到linux

    1.Install the .NET SDK 我的服务器是腾讯云的Ubuntu 16 注册Microsoft密钥和订阅源 wget -q https://packages.microsoft.com/ ...

  7. Java中处理异常的9个最佳实践

    Java中的异常处理不是一个简单的话题.初学者很难理解,甚至有经验的开发人员也会花几个小时来讨论应该如何抛出或处理这些异常. 这就是为什么大多数开发团队都有自己的异常处理的规则和方法.如果你是一个团队 ...

  8. Java研发工程师知识点总结

    Java研发工程师知识点总结 最近一次更新2017年12月08日 大纲 一.Java基础(语言.集合框架.OOP.设计模式等) 二.Java高级(JavaEE.框架.服务器.工具等) 三.多线程和并发 ...

  9. 数论练习(4)——同余方程(扩gcd)

    CODEVS 1200 同余方程 题目描述 Description 求关于 x 同余方程 ax ≡ 1 (mod b)的最小正整数解. 输入描述 Input Description 输入只有一行,包含 ...

  10. TCP报文格式和三次握手——三次握手三个tcp包(header+data),此外,TCP 报文段中的数据部分是可选的,在一个连接建立和一个连接终止时,双方交换的报文段仅有 TCP 首部。

    from:https://blog.csdn.net/mary19920410/article/details/58030147 TCP报文是TCP层传输的数据单元,也叫报文段. 1.端口号:用来标识 ...