Figure 1 shows an example in which three items of "name", "name" and "e-mail" are specified as sort keys on the customer model list display screen.
When displaying the screen, arrange by the first sort key.(In this example, it is in alphabetical descending order.)
Items specified as sort keys can be clicked on the item name part.Click to sort by that item.Click on the same item to reverse the sort order.
Figure 2 shows an example of switching email items to alphabetical ascending sort.
The sort key is memorized for each screen and for each user.When you finish using it and logging on again, the list screen sorted by the last specified sort key is displayed.
When "Clear search condition" is done on the search screen, it returns to the initial sort order at the same time as re-search.
Figure 3 shows the definition of the customer model used in the sample.Here, we will set the sort key for the three items "name" "name" and "e-mail".
Open the model item detail definition.In the column "sort order" of each itemA numberSpecify.It is allocated as first sort key, second sort key ... in ascending order of numbers.(FIG. 4, FIG. 5, FIG. 6)
If "Minus" is specified before the numerical value, the initial sort rule will be reverse sorted.("E-mail" item in FIG. 4)
Sorting is realized by SQL processing (ORDER BY clause) of the database. Therefore, rules change depending on the database.
Sorting is realized by the ORDER BY clause of the database.Therefore, items not to be stored in the database can not be specified as a sort key.
Sorting with a value of "NULL" is handled differently by the database.
It is deprecated to sort model reference items.
The reason is that model reference items are sorted by "ID value".In many cases, you will get the impression that the displayed contents and the sort order do not match.
Reference linked itemSave your modelIt is necessary to be.
The primary key is always included in the sort key.