zoukankan      html  css  js  c++  java
  • comebotree树

    comebotree树:

    java:

    @RequestMapping(value="/combobox.do")

    public @ResponseBody
    String combobox(String booid){

    List<Map<String, Object>> list =new ArrayList<Map<String, Object>>();

    List<TestModel> rs=testService.getlists(booid);

    for(TestModel md:rs){

    Map<String, Object> map = new HashMap<String, Object>();//定义map
    map.put("id", md.getBookid());
    map.put("text", md.getSummarize());


    String pid=String.valueOf(md.getBookid());
    int count=testService.getcount(pid);
    if(count>0)
    {
    map.put("state", "closed");
    }else{
    map.put("state", "open");
    }

    list.add(map);

    }

    System.out.println(JSON.toJSONString(list));

    return JSON.toJSONString(list);
    }

    页面:

    $('#CC').combotree({
    valueField:'id',
    textField:'text',
    editable:false,
    panelHeight:'auto',
    value:'',
    url:'test/combobox.do',
    onLoadSuccess: function (node, data) {

    //异步树全部自动展开
    var t = $(this);
    if (data) {
    $(data).each(function (index, d) {
    if (this.state == 'closed') {
    t.tree('expandAll');
    }
    });
    }

    },
    onSelect:function(value){
    console.log(value);
    },

    //异步树动态展开
    onBeforeExpand:function(node){
    console.log("---node---",node);
    $('#CC').combotree("tree").tree("options").url= "test/combobox.do?booid=" + node.id;


    }
    });

  • 相关阅读:
    密码学浅析
    FireWall Mark + LVS
    tcp/ip首部
    iptables(二)网络防火墙
    BIND服务
    LVS(一)
    QQ、微信消息轰炸
    LVS四种模型(二)
    安装和克隆
    压缩和打包
  • 原文地址:https://www.cnblogs.com/xiexy/p/4136848.html
Copyright © 2011-2022 走看看