Allow sorting a table by a hidden column

Hi! I'd like to request being able to sort a table by a hidden column. Maybe this should go hand-in-hand with being able to disable sorting for all columns at once (since it would be confusing to be able to change sorting, but not restore it to its default).

Currently, hiding a column that is used for sorting by default reverts the ordering to its default.

Hey lumeo_jplatte! I believe that the table component does support sorting by hidden column. I've attached some screenshots here:



I've hidden the id column, but the Default column to sort by still changes the values in the table when selecting id and switching between descending and ascending. Were you looking for different behavior?

In my case, the hidden column is a "custom" (computed) column. Maybe that's why it doesn't work?

Could you share your table set up? It seems that I can sort by a hidden custom column as well. . .




The example you posted could actually just as well be sorted by ID. Ascending vs Descending is still taken into account, just it applies to the first column (for me at least).

Can you still sort by the hidden custom column in your example above if its value is {{ currentRow['sales'] % 2 }}?

Ahhh, definitely an oversight on my end here. Didn't realize I was effectively just reusing the id data-set. You are correct that sorting by a hidden custom column does not work. I'll submit an internal feature request and update this thread whenever I have additional information!

I have now worked around this by doing the sorting in SQL.

Hey!

I'm sorting a table by a hidden column - in this case it's because I'm showing the user a formatted text revenue column, but also using a hidden raw_revenue column that shows the actual numerical value.

Imagine a table:

revenue raw_revenue

$2.36 2.36
$12.40 12.4
$22.10 22.1

Now, I want to sort the table by raw_revenue on the backend, but I also want to stop the user trying to sort the table by revenue - because doing that will mean they can't go BACK to the raw_revenue sorting without refreshing the page.

So what I'd like is a way to disable column sorting on a table - just like I can disable row selection.
image

Hey Henry14! Thanks for the feedback. You can currently disable sorting for individual columns in the column editor. So if you would like to disable sorting by revenue, you can do that. To disable sorting on the table as a whole, you would have to toggle that option on every column. I'll add a feature request for a master toggle that would disable sorting for every column, but wanted to let you know what option is available currently.\

Thank you! That's super helpful :slight_smile: