Assume I have a table with columns that have headers “1”, “2”, “3”. When they are fetched form the datasource they come in some random order (“2”, “1”, “3”). Without using the UI and dragging and dropping the columns can I programmatically sort them so they are displayed as “1”, “2”, “3”?
Is it possible to do that but have some of the columns still frozen in place using freeze column functionality?
I don’t think this is possible. If you want the columns to be in a certain order then you can reorder the columns in the tables property pane. They will always display in that order once you set it.
Can you elaborate what you mean by have some of the columns still frozen?
Sometimes the columns that come from the data are dynamic as a projection or an aggregation of source data. In this case, it would be nice to be able to sort them instead of them coming out in random order.
I don’t think this is a product issue. You’ll have to use JavaScript to handle this. I found a related article on Stack Overflow about sorting the keys of an object. I think it’s a good starting point to accomplish your use case. Could you give it a look?
I looked at that and I don’t think that addresses the issue.
There must be some sort of an ‘order’ property that is being set on the column object when the user drags the column in the properties pane. Having access to that property programmatically will solve the issue.