Topic: How to set sortField and sortOrder in dataTables populated using Ajax
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
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Open
- 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
Grzegorz Bujański staff commented 2 years ago
At the moment yes. We'll check what's going on and try to fix it as soon as possible