Perspective Table sortOrder Property

I couldn’t find any documentation on this. How do you use the sortOrder property on the Perspective Table? Can someone please provide me an example? I’ve trying to have the table load with one column as the primary column to sort on and then a second column to do a secondary sort of the rows. Is this what the sortOrder property is for?

1 Like

I am looking for an example also.

1 Like

same question…

The sort order property should be an array of column names - the order they’re in will be the order they’re sorted by.

Each column config can have a sort key with a value of ascending or descending to control the sort direction.

At least, that’s how it should work based on scanning the code :man_shrugging:

I succeeded in specifying the sort order by adding elements in the “sortOrder” property array, and for each element’s value, I specified the “field” id for each column object – in order of sort priority (e.g. “0:t_stamp” for highest priority sorting on t_stamp column of the table, “1:Comments” for 2nd highest priority sorting on Comments column, etc.). The sort direction is selected using the “sort” object-member of each column object within the “columns” table property. The “sort” object-member provides a drop down menu to select between “none”, “ascending”, and “descending”.

This method worked in the designer preview mode, but for some reason, it is not working when I launch the perspective session. Any ideas why this may be?