Topic: How to programmatically sort advanced datatable?

sebklopfer free asked 3 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 3 years ago


Hi,

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 https://mdbootstrap.com/snippets/standard/d-wajszczuk/3201627#html-tab-view. I hope that this will solve your problem.

Keep coding,
Dawid



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: 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