Page 1 of 1

Table sort

PostPosted: Wed Mar 27, 2019 12:00 pm
by lucdep

Is it possible to define in code how a Navigationtable must be sorted by default?
I know you can sort by clicking on the header, but I would like to force the tabel in a default setting when opening the screen.
I have seen there are some .setSort* methods available, but he exact function of them is not clear to me.



Re: Table sort

PostPosted: Wed Mar 27, 2019 5:44 pm
by Support@SIB
You have different options:

Client-side sort (visible to the user with arrows in header)
Server-side default sort (not visible to the user)

Client-side sort via DataBook:

Code: Select all
dataBook.setSort(new SortDefinition("TITLE"));

The (Navigation)Table reads the sort definition from the model and shows small arrows. It's also possible to use VisionX Designer to set the default sort, by clicking on the header column (Ctrl to use more than one column).

Server-side sort via Storage:

Code: Select all
storage.setDefaultSort(new SortDefinition("TITLE"));

The SortDefinition class has different constructors to configure ascending/descending per column.