-2
我試圖讓我目前的下拉列表(腳手架由mvc)搜索。如何在mvc5中創建可搜索的下拉列表?
我添加了這個腳本,但沒有幫助。
<script type="text/javascript">
$(document).ready(function() {
$("select").searchable({
maxListSize: 100,
maxMultiMatch: 50,
exactMatch: false,
wildcards: true,
ignoreCase: true,
latency: 200,
warnMultiMatch: 'top {0} matches ...',
warnNoMatch: 'no matches ...',
zIndex: 'auto'
});
});
這些都是我的下拉列表
<div class="form-group">
@Html.LabelFor(model => model.CustomerID, "CustomerID", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("CustomerID", null, htmlAttributes: new {@class = "form-control" })
@Html.ValidationMessageFor(model => model.CustomerID, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.VideoID, "VideoID", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("VideoID", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.VideoID, "", new { @class = "text-danger" })
</div>
</div>