Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Issue with Select fields within a td of a datatable not working

kelley premium asked 2 years ago


Expected behavior I have added a select field in a datatable/ which is to show the current value from the db and also contain a list of items you can change to which will update once the user clicks save.

Actual behavior The issue is that the select field will not populate.. once i take out (class="select") from the select control, it works but the field lacks any css. Resources (screenshots, code snippets etc.)


Mateusz Lazaru staff answered 2 years ago


Our Datatable component is creating new HTML table element based on the one created by you and replaces them.

As you see, it doesn't take classes and data-attributes from basic <table> - this is why this issue occured.

However if you create <select> element without initializing mdb.Select and initialize it after new table is created.

Snippet: https://mdbootstrap.com/snippets/standard/mlazaru/4573833#js-tab-view


kelley premium answered 2 years ago


i am attaching a code sample:

code sample


kelley premium answered 2 years ago


i use the code in other areas that are not within a table and it works just fine



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

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: windows
  • Browser: chrome
  • OS: windows 10
  • Provided sample code: No
  • Provided link: No