Change DataTable sorting logic

UI Components for Vue
Post Reply
hargitomi97
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.

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

26 Dec 2022, 10:19

This is JavaScript standard. Please check https://developer.mozilla.org/en-US/doc ... Array/sort

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests