Hi everyone, I was wondering if its possible to reset to the default sort for a table via scripting, if I have multiple sort conditions?
I initially have a default sort on 3 variables, such that when I load in my table, the sortArray
property has 3 objects.
I realized in the script section you can sort using table.setSort({columnId: "a", direction: "asc"})
, but when I try to reset all 3 at once, it does not work as intended.
E.g in my script I will write
table.setSort({columnId: "a", direction: "asc"})
table.setSort({columnId: "b", direction: "asc"})
table.setSort({columnId: "c", direction: "asc"})
but after inspecting the state, I see that only table.setSort({columnId: "c", direction: "asc"})
is applied, and the length of sortArray
is 1. I have also tried letting setSort take in an array but from the API that doesn't seem to work. I also have not seen any methods that may help me achieve this. Any help would be greatly appreciated!