Table sort order

I have a window with 2 buttons to swap entries between 2 tables. I manually populate both tables with data when the window opens. When I swap an entry from one table to another, I would like the table to be displayed in alphabetical order. I can achieve this by clicking on the appropriate column header once the window is opened, but can I either sort the table in code, or force the table to default to sorting by a particular column when the window opens?

This seems like a good step to do the sorting in. We can add a "sortByColumn(columnName)" function, but in the meantime seems like you could do this yourself.

We went ahead and added:

table.sortByColumn("MyColumn", 0)

where the 2nd argument is 1=ascending, 0=descenging, and

table.sortOriginal()

for 7.1.3

While we’re on the topic of tables and sorting, would it be possible to add an option to the table component to disable the ability to sort by clicking the column headers? Although I don’t have a designer handy, I’m pretty sure even if the table is not enabled, the user can still sort. For certain datasets, such as recipes, it doesn’t make much sense to sort anything, and would probably only add confusion if a sort was accidentally clicked and the operator didn’t realize/undo it.

Thanks,

Dan

Yeah that sounds reasonable, I’ll take a look

Ok, this is done for 7.1.3