Skip to main content
Solved

How to get record by manual sort?

  • October 29, 2020
  • 2 replies
  • 52 views

I can get records sorted by some field like below

  const records = useRecords(table, {
    sorts: [{ direction: 'desc', field: actionField }],
  });

but how can I get records sorted by manual order?

Best answer by Kamille_Parks11

What do you mean by manual order? You can adopt the sorting of a particular view by pulling records from there as opposed to a table. Otherwise its going to be records.sort((a,b) => {insert your sorting logic here})

2 replies

Kamille_Parks11
Forum|alt.badge.img+27
  • Brainy
  • 2679 replies
  • Answer
  • October 29, 2020

What do you mean by manual order? You can adopt the sorting of a particular view by pulling records from there as opposed to a table. Otherwise its going to be records.sort((a,b) => {insert your sorting logic here})


  • Author
  • New Participant
  • 4 replies
  • October 29, 2020

What do you mean by manual order? You can adopt the sorting of a particular view by pulling records from there as opposed to a table. Otherwise its going to be records.sort((a,b) => {insert your sorting logic here})


You can adopt the sorting of a particular view by pulling records from there as opposed to a table

That’s the solution.Thanks a lot!