zoukankan      html  css  js  c++  java
  • 多个下拉框,按顺序选择

    多个下拉框,按顺序选择,并且每个下拉框中内容相同

     var myArray = [];
            function funDllEvent() {
                $(".easelect").change(function () {
                    //console.info(myArray);
                    var vVal = $(this).attr("index");
                    var vDdlIndex = parseInt(vVal) - 1;
                    if ($(this).val() != "") {
                        //获取事件
                        if ($.inArray($(this).val(), myArray) >= 0) {
                            var msgModel = { MsgType: "warning", msg: "选择项(" + $(this).find("option:selected").text() + ")重复", result: false, msgTitle: "系统提示" };
                            BPM.ShowMsg(msgModel);
                            $(".easelect:eq(" + vVal + ")").val("").chosen("destroy").chosen();
                            //return false;
                        } else {
                            myArray[vDdlIndex] = $(this).val();
                            //return true; 
                        } 
                        $("#dropBudCol" + (parseInt(vVal) + 1)).prop('disabled', false).trigger("chosen:updated");
                    }
                    else { 
                        var vSel = myArray[vDdlIndex]; 
                        var vArrIndex = vDdlIndex; //要移除的数组索引 固定不变
                        var vArrLen = myArray.length;//数组长度
                        for (var i = vArrIndex; i < vArrLen; i++) {
                            myArray.splice(vArrIndex, 1); //删除元素
                        }
                        $(".easelect:gt(" + vDdlIndex + ")").val("").chosen("destroy").chosen();
                        $(".easelect:gt(" + vDdlIndex + ")").prop('disabled', true).trigger("chosen:updated");
                    }
                    console.info(myArray); //测试已通过
                    console.info("-------------------------");
                });
                $(".easelect:gt(0)").prop('disabled', true).trigger("chosen:updated");
            }


  • 相关阅读:
    微信小程序HTTPS
    微信商城-1简介
    va_list
    Event log c++ sample.
    EVENT LOGGING
    Analyze Program Runtime Stack
    unknow table alarmtemp error when drop database (mysql)
    This application has request the Runtime to terminate it in an unusual way.
    How to check if Visual Studio 2005 SP1 is installed
    SetUnhandledExceptionFilter
  • 原文地址:https://www.cnblogs.com/MartinLee/p/7622628.html
Copyright © 2011-2022 走看看