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
    再三须慎意,第一莫欺心
  • 相关阅读:
    数据类型的总结
    typeof加括号和不加括号的区别
    排序
    数据类型分为哪两类
    css中需要更小的字体如何实现
    一些细节注意点
    数值转换题
    如何用分支结构计算年份
    Scout YYF I
    D. AND, OR and square sum
  • 原文地址:https://www.cnblogs.com/otsf/p/8707684.html
Copyright © 2011-2022 走看看