Change DataTable sorting logic

UI Components for Vue
Post Reply
Posts: 1
Joined: 01 Dec 2022, 13:56

01 Dec 2022, 14:01

Is there a way to change the logic of the Datatable's sorting mechanismon the columns? If so, how can I achieve it?

We would like to move empty fields to the bottom of the sorting both in ascending and in descending order.

Example elements: "aaa", "", "ccc", "bbb", ""
Current result (ascending): "","","aaa","bbb","ccc" (Descending works fine)

Desired result (ascending): "aaa", "bbb", "ccc", "", ""
Desired result (descending): "ccc", "bbb", "aaa", "",""

Thank you for the help.

Posts: 478
Joined: 23 Oct 2020, 09:28

26 Dec 2022, 10:19

This is JavaScript standard. Please check ... Array/sort

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests