Topic: How to programmatically sort advanced datatable?

sebklopfer free asked 2 years ago

Does anyone know the javascript function to programmatically sort the advanced datatable? I need to pre-sort the table on page load.

Dawid Wajszczuk staff answered 2 years ago


I would suggest using data-mdb-sort-field="your_field_to_sort" and data-mdb-sort-order="desc or asc" attributes with your Datatable. Here is the snippet with example I hope that this will solve your problem.

Keep coding,

Please insert min. 20 characters.


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



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No