I have a table bound to a named query that returns a list of orders. I have a Priority column which I would like to sort.
In the designer, I only have the Priority column selected as sortable and also have sort as ascending. Following the advice from other posts, I left the numberFormat to none.
In the designer, the table is sorted correctly. I can also change the sort property and the table will reflect the change in preview mode.
However, when I open the view in browser. I get this. Notice that the sort arrow is not selected.
No matter what I set the column's sort property to, the browser view does not change.
I have tried setting sortOrder, but that does not help.
The only way for the browser view to appear sorted is to add ORDER BY [Priority] ASC
to the named query.
This works, but my expectation is that I should be able to configure the table columns to sort.
What if it is not practical to pre-sort the generated dataset?
Is there a way to fire off a similar event to a user clicking a column to sort it?
I don’t want my table to be pre-loaded with data (lots of rows) and I prefer to fire an update (manually or on page load) to refresh the data source.
But doing so means I lose the pre-sorted column. I’ve also set the required column properties to enable sort and set sortOrder but that only seems to work if you have data in the table already, not when its updated later.
Why? There are numerous binding and expression and transform options. (Particularly in my Integration Toolkit.)
You have to plan around what is possible with your chosen component(s). As you have admitted, you cannot apply table sort settings before there is data, or when data changes. With that constraint, pre-sorting is the only option.
(Probably. Change events might help.)
Make a feature request. Presort until that is implemented.