Ich bin mir ziemlich sicher, dass mein Problem etwas mit dem Skript zu tun hat.bootstrap selectpicker MVC dropdown livesearch
Ich habe es mein Bündel hinzugefügt
bundles.Add(new ScriptBundle("~/bundles/bootstrap-select").Include(
"~/Scripts/bootstrap-select.js",
"~/Scripts/bootstrap-select.min.js"));
hier ist meine Ansichten Code:
<script type="text/javascript">
$(document).ready(function() {
$('.selectpicker').selectpicker({
liveSearch: true,
showSubtext: true
});
});
HTML-Formular:
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.SagId, "SagId", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownListFor(x => x.SagId,(IEnumerable<SelectListItem>)ViewBag.SagId,
new
{
@class = "form-control selectpicker",
data_show_subtext = "true",
data_live_search = "true"
})
@Html.ValidationMessageFor(model => model.SagId, "", new { @class = "text-danger" })
</div>
</div>
ich die Liste aus meiner Sicht Tasche bekommen, das funktioniert gut. Aber ich kann das Problem nicht beheben.
Update: versucht, manuell References in der Ansicht hinzuzufügen. jetzt ist die Dropbox komplett verschwunden und ich bekomme theese Fehler:
Uncaught TypeError: Cannot read property 'valHooks' of undefined
at bootstrap-select.min.js:7
at bootstrap-select.min.js:8
at bootstrap-select.min.js:7
at bootstrap-select.min.js:7
erstellen: 78 Uncaught Reference: definiert $ nicht bei erstellen: 78
Welches Problem können Sie nicht beheben? –
Es wendet nicht den Stil/Javascript auf meine Dropdownliste an. –
Ich möchte, dass es in etwa so aussieht: http://jsfiddle.net/codeandcloud/a5r2vyu2/1/ –