We have a number of applications which present a data grid which allows the user to click on column headers to sort data (using the pfc service).
One issue is that nulls always sort to the top in datawindows - which can be really aggrevating when there is a lot of null data.
We dont want to fill all the date with dummy dates or empty strings.
Is there a way to tell a datawindow to sort nulls to the top or bottom always?
Ideally have these many decades it would be great if Appeon put a "Sort Nulls As" feature in the column definition. Maybe its there and I am unaware.
As I am using the pfc and it essentially grabs the column name from the headername (extracting the -t) creating a setSort
I did some experimenting in the debugger and it looks like the Set Sort function may accept datawindow functions - so instead of
of_setSort ("mydate a")
I can do
of_setSort ("If(IsNull(mydate, 1900-01-01, mydate)
I never so this is an example in the documentation - is this supported?
IF Trim(is_sortorder) = 'A' THEN
ls_sortstring = "If(IsNull(" + is_sortcolumn + "), 1, 0)" + is_sortorder + ", " + is_sortcolumn + is_sortorder
ELSE
ls_sortstring = "If(IsNull(" + is_sortcolumn + "), 0, 1)" + is_sortorder + ", " + is_sortcolumn + is_sortorder
END IF
ls_sortstring = "If(IsNull(" + is_sortcolumn + "), 1, 0) A, " + is_sortcolumn + is_sortorder
Thanks for the idea on the combining columns.
Of course this only solves the header click via the PFC - not the other sorting features.
However, I would still hope that Appeon could add a functionality that would assert Sort Nulls to botton rather than to the top. People who use grids expect them to sort as exce does.