Skip to content

Commit 4230f43

Browse files
committed
Document per-field default sort order for list view sort fields
ref WoltLab/WCF@a42cbbe
1 parent b0e7133 commit 4230f43

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎docs/php/api/list_views.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ Optionally, you can specify the name of an alternative database column to be use
120120
new ListViewSortField('title', 'wcf.global.title', 'table_alias.columnName'),
121121
```
122122

123+
Each sort field can declare its own default sort order via the `defaultSortOrder` argument (`ASC` or `DESC`).
124+
When the user switches to a different sort field via the sorting dropdown, the field's default sort order is applied instead of always defaulting to `ASC`:
125+
126+
```php
127+
new ListViewSortField('time', 'wcf.global.date', defaultSortOrder: 'DESC'),
128+
```
129+
123130
The default sorting can be defined after the configuration of the sort fields has been defined:
124131

125132
```php

0 commit comments

Comments
 (0)