zoukankan      html  css  js  c++  java
  • select 多选 (EasyUI)

    <script type="text/javascript" src="/EasyUI/jquery.min.js"></script>
    <script type="text/javascript" src="/EasyUI/jquery.easyui.min.js"></script>
    <select id="ddlyou" runat="server" class="easyui-combotree" style=" 205px; height: 24px;">
    </select>

    只能是 id 与 text的固定组合
    <%=ViewState["check"]%> 是数据来源
     $(function () {
            $('#<%=ddlyou.ClientID%>').combotree({
                valueField: "id", //Value字段
                textField: "text", //Text字段
                multiple: true,
     
                data: [{ "id": "0", "text": "All", "children": <%=ViewState["check"]%> }]
    ,
    data: [{ "id": "0", "text": "All", "children": [{ "id": 13, "text": "C1" }, { "id": 14, "text": "C2" }, { "id": 15, "text": "C3"}]}]
    ,
     
                //url: "tree_data2.json", //数据源
                onCheck: function (node, checked) {
                    //让全选不显示
                    $("#<%=ddlyou.ClientID%>").combotree("setText", $("#<%=ddlyou.ClientID%>").combobox("getText").toString().replace("全选,", ""));
                },
                onClick: function (node, checked) {
                    //让全选不显示
                    $("#<%=ddlyou.ClientID%>").combotree("setText", $("#<%=ddlyou.ClientID%>").combobox("getText").toString().replace("全选,", ""));
                }
            });
        });

    var youpin = document.getElementById("_easyui_textbox_input3").value;  选中的值 //_easyui_textbox_input3  替换成对应id
    再三须慎意,第一莫欺心
  • 相关阅读:
    C# 数据为空,不能对NULL调用此方法或属性的解决办法
    Hadoop开启后jps显示只有jps
    Ubuntu中eclipse端口被占
    Ubuntu在终端执行命令时出现的错误
    sudo passwd root输入普通用户密码后显示用户不再sudoers文件中
    周总结(4.4)
    《构建之法》读后感(三)
    周总结(3.28)
    软件工程团队项目介绍
    解决phpstudy中nginx服务器运行项目报错404问题
  • 原文地址:https://www.cnblogs.com/otsf/p/8707684.html
Copyright © 2011-2022 走看看