Topic: Search in Dropdown

kalteis pro asked 3 years ago


I am Trying to use the search functionality in the dropdown-menu. I have the MDB-Pro version and I have downloaded the newest version of "JQuery" too. The JS for the search in dropdown was included in a script tag on the page. Like this: "< script> $('#your-custom-id-button').mdbDropSearch(); < /script>". But I still get an error "Uncaught TypeError: $(...).mdbDropSearch is not a function" when the page with the function is loaded. The search functionality is also not working.


Diego free commented 2 years ago

did you ever got it working?


Mateusz Łubianka staff answered 2 years ago


HI @kalteis,

I just checked it in 4.14.0 and it works well. Just place init function into $(document).ready function.

<!-- jQuery -->
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <!-- Bootstrap tooltips -->
  <script type="text/javascript" src="js/popper.min.js"></script>
  <!-- Bootstrap core JavaScript -->
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <!-- MDB core JavaScript -->
  <script type="text/javascript" src="js/mdb.min.js"></script>
  <!-- Your custom scripts (optional) -->
  <script type="text/javascript">
    $(document).ready(function() {

      $('#your-custom-id').mdbDropSearch();
    })
  </script>

Best,



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.6.1
  • Device: PC
  • Browser: ALL
  • OS: ALL
  • Provided sample code: No
  • Provided link: No
Tags