Topic: Problem with datatable
Michaël De Schutter pro premium priority asked 8 months ago
Expected behavior
I'm utilizing a datatable to display data retrieved from a database.My expectation is that the data is displayed within the table. When conducting a search that doesn't yield any results, I expect the table to display a message such as "No matching results found.".
Actual behavior
While the data is correctly displayed within the table, there is an issue where the message "No matching results found" appears as the first record, even when no search has been conducted. Additionally, this message seems to be searchable itself, as if it were a regular record.
Resources (screenshots, code snippets etc.)
snippet: https://mdbootstrap.com/snippets/standard/michael_de_schutter/6008949
Kamila Pieńkowska staff answered 8 months ago
You need to change your approach a little. You need to base your code on async example since you use data retrived from datatabase to generate datatable.
You did double init on datatable via datat attribute and then second time with JS which is propably cause of this bug.
Michaël De Schutter pro premium priority commented 8 months ago
Thank you. I deleted the 'data-mdb-datatable-init'. This solved the problem
Kamila Pieńkowska staff answered 8 months ago
You need to publish your snippet for me to be able to access it.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 7.1.0
- Device: Laptop
- Browser: Chrome
- OS: Windows 11
- Provided sample code: No
- Provided link: Yes