Topic: How to set sortField and sortOrder in dataTables populated using Ajax
Torroni pro asked 4 months ago
Expected behavior change sortField and sortOrder values when populating a dataTable using Ajax
Actual behavior sortField and sortOrder options can only be set on init (i.e. when creating a new instance), setting their values in the update method has no effect. This means that it is not possible to change the sort field or sort order when the table is populated. This would be a useful feature to simulate server-side sorting (since this feature is not available). Do I have to delete and re-create the instance every time to obtain the desired behaviour?
Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/torroni/5254518
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Pro
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: laptop
- Browser: Google Chrome Version 112.0.5615.121 (Official Build) (64-bit)
- OS: Windows 10 Enterprise 22H2
- Provided sample code: No
- Provided link: Yes