Allow a user to change the display order of an individual record in a table on a page

I’d like to know if anyone has any experience or ideas in how best to add functionality to a data table on a page so that the user could change the displayed order of an individual record by moving it up and down in the table of records? I’m thinking of adding two action buttons to the data table (up and down arrow) and adding a sort field value. I’d then need to have a pipe I guess with the renumbering in it…

1 Like

Hey! I think there are probably a few creative ways to do this but first - what is the end goal for doing this? You just want the table to be displayed differently for the user? Is it a view thing? Or more that you want to actually change the record order in the table?

Hey @Sam, thanks for your interest and reply.

It’s so that the order of the records in Table Pages and Tables in PDF Pages can be reordered by the user.

Each record details part of a journey (actually a physical journey a vehicle will travel through). For example there might be a number of legs to the journey. It may start in the UK, move to France, then Germany and reaching it’s destination in Poland and then it might come back the same way or a different route via Slokavia, Austria Germany, France and then the UK. Each record denotes a country or leg in the journey.

Once the original route is created it can be amended and then we need to list the route records in logical order.

I’m imagining a interface that have action buttons on each row with a :arrow_up_small: and a :arrow_down_small: arrow which when clicked moves the records up or down the displayed list.

I’m open to other ways of achieving this but the arrows would be my preferred method as I think this is quite intuitive.

Let me know if you need any further info. I’d imagine this would be a useful feature for many applications and also wondered whether the management / dev team have considered adding such a feature to the core Page Table functionality.

Any ideas or feedback gratefully received.

Hey Greddie,

We don’t currently have the up and down arrow options to reorder records. However, you could accomplish this by adding a number field to the table and component and setting the default sort order to use the number field. Now the user can fill out the legs of the journey by number and it will sort them in order:

Hope this helps!

I’m looking for something a little more intuitive for the user. I’ll have a go at scripting something and post the update here if I crack it.

Thanks for your input though