Order table column headers

Is there any way to stop table headers in Perspective from sorting alphabetically?

The order I have in my ‘data’ for the table is Location, Name, Time, Status, Active. However, when I view it on the web browser the headers are rearranged:

1 Like

It will sort by default. If you do NOT want the alpha sorting, you need to set the ordering yourself by explicitly declaring each column.

Please look at Table.props.columns. Click “Add Array Element”, as many times as you have columns you would like represented (essentially, you will need a Table.props.columns entry for EACH column you want displayed. For each column entry you’ve just created, set Table.props.column[x].field to the name of the data column you want this Table column to represent.

In your use-case, you should see something like:

Table.props.columns[0].field = "Location"
Table.props.columns[1].field = "Name"
Table.props.columns[2].field = "Time"
Table.props.columns[3].field = "Status"
Table.props.columns[4].field = "Active"
2 Likes

That worked, thanks!

1 Like

I have been looking for this for a few days on Google. It finally popped on my search Safari tonight. Thank you so much for posting this.

1 Like