This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Table sort

Frequently asked questions about VisionX.

Table sort

Postby lucdep » Wed Mar 27, 2019 12:00 pm

Hi,

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.

Thanks


Luc
lucdep
 
Posts: 53
Joined: Wed Oct 10, 2018 12:01 pm

Re: Table sort

Postby Support@SIB » Wed Mar 27, 2019 5:44 pm

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.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm


Return to VisionX