I am working on a dropdown list forum and want to incorporate a search feature. I decided to implement the selectpicker library for this purpose, but I keep encountering an error in the console that says
Uncaught TypeError: Cannot read properties of undefined (reading 'Constructor')
.
DropdownListFor :
<div class="mb-3">
@Html.LabelFor(m => m.Repairs.urunAd, "Ürün", new { @class = "form-label" })
@Html.DropDownListFor(m => m.Repairs.urunID, Model.ProductsList, "Lütfen Bir Ürün Seçiniz*", new
{
@class = "selectpicker form-control repair-inputs",
id = "repairProductInput",
required = "required",
data_live_search = "true"
})
</div>
Libraries :
<link href="~/Content/css/repair.css" rel="stylesheet" />
<link href="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9cbc6c6dddadddbc8d984ddc8cbc5cce998879b9b8798">[email protected]</a>/dist/bootstrap-table.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc9e9393888f888e9d8cd18f9990999f88bccdd2cdcfd2cdc8">[email protected]</a>/dist/css/bootstrap-select.min.css">
<script src="~/Scripts/jquery-3.7.0.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93f1fcfce7e0e7e1f2e3bee0f6fff6f0e7d3a2bda2a0bda2a7">[email protected]</a>/dist/js/bootstrap-select.min.js"></script>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2d0ddddc6c1c6c0d3c29fc6d3d0ded7f2839c80809c83">[email protected]</a>/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3d5f5252494e494f5c4d10495c5f51587d0c130f0f130c">[email protected]</a>/dist/bootstrap-table-locale-all.min.js"></script>
<script src="~/Content/js/repair.js"></script>
<script>
$(document).ready(function () {
$('.selectpicker').selectpicker();
});
</script>