zoukankan      html  css  js  c++  java
  • 组装树状结构文本框

     jsp代码===

    <tr>
    <td align="right">监测类别:</td>
    <td><select class="easyui-combotree" style="margin-top: 7px"
    name="monitoringCategory" id="monitoringCategory"
    data-options="editable:false">
    <option value="">请选择监测类别</option>
    </select></td>
    <td align="right">产品类别:</td>
    <td><select name="productCategory" id="productCategory"
    class="easyui-combotree" data-options="editable:false">
    <option value="">请选择产品类别</option>
    </select></td>
    </tr>

    js代码=======

    //加载监测类别字典(添加)
    $("#monitoringCategory").combotree({
    url: '<%=basePath%>xyData/dict/LookupDictFid.do?fid=' + '213',
    valueField: "id",
    textField: "text",
    lines: true,
    required: true,
    onBeforeExpand: function (node, param) {
    $(this).tree('options').url = "<%=basePath %>xyData/dict/LookupDictFid.do?pid=" + node.id + "&fid=" + '213';
    },
    onBeforeSelect: function(node) {
    if (!$(this).tree('isLeaf', node.target)) {
    return false;
    }
    }

    });

    //加载产品类别字典(添加)
    $("#productCategory").combotree({
    url: '<%=basePath%>xyData/dict/LookupDictFid.do?fid=' + '214',
    valueField: "id",
    textField: "text",
    lines: true,
    required: false,
    onBeforeExpand: function (node, param) {
    $(this).tree('options').url = "<%=basePath %>xyData/dict/LookupDictFid.do?pid=" + node.id + "&fid=" + '214';
    },
    onBeforeSelect: function(node) {
    if (!$(this).tree('isLeaf', node.target)) {
    return false;
    }
    }
    });

    //修改==========

    //加载监测类别字典(修改)
    $("#monitoringCategory1").combotree({
    url: '<%=basePath%>xyData/dict/findAllByFid.do?fid=' + '213',
    valueField: "id",
    textField: "text",
    lines: true,
    required: true,

    loadFilter: function (data) {
    return data;
    },
    onBeforeSelect: function(node) {
    if (!$(this).tree('isLeaf', node.target)) {
    return false;
    }
    }

    });

    //启用
    $("#ProfessionMonitoring").combotree('enable');
    //禁用
     $("#ProfessionMonitoring").combotree('disable');
    //data-options
    data-options="editable:false"
    disabled boolean 定义是否禁用该字段

    //给树状结构文本框赋值

    $('#monitoringCategory1').combotree('setValue', result.msg.monitoringCategory);

  • 相关阅读:
    转-iOS开发系列--地图与定位
    转-关于UIView的autoresizingMask属性的研究
    UIAlertController的使用,代替UIAlertView和UIActionSheet
    设置当前导航栏(navigationController)的标题
    tabBar隐藏方式
    ubuntu 安装qq 及解决安装完搜狗输入法不显示键盘的方法
    python 读写文件
    Ubuntu:如何显示系统托盘图标(systray)
    python tesseract 识别图片中的文字的乱码问题(ubuntu系统下)
    让Ubuntu可以压缩/解压缩RAR文件
  • 原文地址:https://www.cnblogs.com/xianz666/p/12180877.html
Copyright © 2011-2022 走看看