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
    再三须慎意,第一莫欺心
  • 相关阅读:
    想不明白为什么不复用老接口?
    dubbo入门教程-从零搭建dubbo服务
    使用Node.js时如何引入jQuery
    博客园在我的博客添加点击小心心特效
    博客园在微信内置浏览器打开时添加微信赞赏码功能
    Keepalived
    双网卡服务器使用指定网卡互通不同网段数据
    LNMP详解
    Centos7数据实时同步(Rsync+inotify)
    解决Centos7本机时间与实际时间相差8小时
  • 原文地址:https://www.cnblogs.com/otsf/p/8707684.html
Copyright © 2011-2022 走看看