File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed
docs/general-concepts/forms-fields/standard-fields Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ The **status** form field type provides a list box of statuses. This field exten
11
11
- ** description** (optional) (translatable) is the [ field description] ( ../standard-form-field-attributes.md#description ) .
12
12
- ** multiple** (optional) if set to true allows multiple items to be selected at the same time. Set to false to allow single selection.
13
13
- ** required** (optional) if set to true, the first field option should be empty, see last example.
14
+ - ** optionsFilter** (optional) Comma-separated list of values to be displayed.
15
+ - ** class** (optional) add the classname ` form-select-color-state ` to add color feedback for the selected state.
14
16
15
17
Implemented by: libraries/src/Form/Field/StatusField.php
16
18
@@ -25,9 +27,29 @@ Implemented by: libraries/src/Form/Field/StatusField.php
25
27
/>
26
28
```
27
29
28
- Based on the source code this returns the following entries in a list:
29
- Trashed - JTRASHED
30
- Disabled - JDISABLED
31
- Enabled - JENABLED
32
- Archived - JARCHIVED
33
- All - JALL
30
+ ## Available options
31
+ Based on the source code this returns the following entries in a list:
32
+
33
+ | Value | Text |
34
+ | ----- | ------------ |
35
+ | -2 | JTRASHED |
36
+ | 0 | JUNPUBLISHED |
37
+ | 1 | JPUBLISHED |
38
+ | 2 | JARCHIVED |
39
+ | * | JALL |
40
+
41
+ ## Filter options
42
+ If this field is used in the element context and not as a filter, the * All* option is not required, for example.
43
+ In such a case, the ** optionsFilter** attribute can be used to select which options should be selectable.
44
+
45
+ ``` xml
46
+ <field
47
+ name =" mystatus"
48
+ type =" status"
49
+ label =" Choose"
50
+ description =" "
51
+ optionsFilter =" 0,1"
52
+ />
53
+ ```
54
+
55
+ The field now only loads the options JPUBLISHED and JUNPUBLISHED.
You can’t perform that action at this time.
0 commit comments