什么是用于禁用MultipleSelect函数中的多项选择和复选框的回调函数

时间:2018-12-20 08:41:50

标签: jquery multiple-select

我只想从下面的代码下面禁用多重选择和复选框选项。为此有任何回呼功能吗? 我的代码:

$('#denialCodesList-@viewId').multipleSelect({
            isopen: true,
            multipleWidth: 55,
            filter: true
        });

1 个答案:

答案 0 :(得分:1)

尝试在初始化时添加selectAll:false。来自docs

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <style>
    .btn:not(:disabled):not(.disabled) {
    cursor: pointer;
}
button, html [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
}
.btn {
    cursor: pointer;
}
.btn, .navbar .navbar-nav > a.btn {
    border-width: 2px;
    border: none;
    position: relative;
    overflow: hidden;
    border-radius: 0.4285rem;
    cursor: pointer;
    background: #344675;
    background-image: linear-gradient(to bottom left, #344675, #263148, #344675);
    background-size: 210% 210%;
    background-position: top right;
    background-color: #344675;
    transition: all 0.15s ease;
    box-shadow: none;
    color: #ffffff;
}
.btn-default {
    color: #ffffff;
    background-color: #344675;
    border-color: #344675;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid transparent;
    padding: 11px 40px;
    font-size: 0.875rem;
    line-height: 1.35em;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
	</style>
</head>

<body>
  <form>
    <div class="input-group">
      <input id="customer-search" type="text" class="key form-control" placeholder="Search">
      <span class="input-group-addon">
        <div>
            <button class="clear btn btn-default" type="button" title="Clear">
                <span class="tim-icons icon-simple-remove">X</span>
      </button>
    </div>
    </span>
    </div>
  </form>
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
  <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>

</html>