You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*String*. Field label (item details) and header (table). You can hardcode it or use i18n.
3
+
## `async`
4
+
*Object*, default: **false**. Property can be specified if field `type` is **select**. Information whether the list is asynchronyous.
5
+
6
+
## `apiObject`
7
+
*Object*, optional. If the field to be displayed in the table is not directly in the downloaded object, but is nested inside the object or the field is to be displayed in an unusual way, then the display method can be specified here.\
8
+
Parameters:
9
+
-`name`: eg. 'car_brand.name',
10
+
-`functions`: array of functions used to modify given field. You can define your functions in **src/helpers/functions.js** file.
5
11
6
12
## `column`
7
13
*String*. The column in the table referenced by the field.
8
14
9
-
## `name`
10
-
*String*. If `apiObject.name` is defined, you must define custom field name. Eg. if table `column` is *car_brand_id*, and its `apiObject.name` is *car_brand.name*, the name may be *car_brand* or *car_brand_name*.
11
-
12
-
## `table`
13
-
*Boolean*, default: **true**. Responsible for displaying the field in the CRUD table.
15
+
## `create`
16
+
*Boolean*, default: **true**. Responsible for displaying the field in the creating item form.
14
17
15
18
## `details`
16
19
*Boolean*, default: **true**. Responsible for displaying the field in the item details.
17
20
18
-
## `create`
19
-
*Boolean*, default: **true**. Responsible for displaying the field in the creating item form.
21
+
## `grid`
22
+
*String*, optional. Vuetify grid used in extended details. This parameter is used to determine the field width on different screens.
20
23
21
24
## `multiedit`
22
25
*Boolean*, default: **true**. Responsible for displaying the field in the multiple update form.
23
26
24
-
## `apiObject`
25
-
*Object*, optional. If the field to be displayed in the table is not directly in the downloaded object, but is nested inside the object or the field is to be displayed in an unusual way, then the display method can be specified here.\
27
+
## `name`
28
+
*String*. If `apiObject.name` is defined, you must define custom field name. Eg. if table `column` is *car_brand_id*, and its `apiObject.name` is *car_brand.name*, the name may be *car_brand* or *car_brand_name*.
29
+
30
+
## `list`
31
+
*Object*, optional. Property must be defined if field `type` is **select**.
32
+
26
33
Parameters:
27
-
-`name`: eg. 'car_brand.name',
28
-
-`functions`: array of functions used to modify given field. You can define your functions in **src/helpers/functions.js** file.
34
+
-`value`: primary key in select recordset.
35
+
-`text`: column with data to be displayed in the select field. If text is the nested property od `data` object then use dots to concatenate elements, eg. `position.person.email`.
36
+
-`complexName`: If record's label must contain multiple fields, use this property instead of `text`. It works the same as `text` but fields must be placed in array:
-`data`: array of list elements. Array item should contain keys from `value` and `text` property. Example:
46
+
```js
47
+
{
48
+
value:'name',
49
+
text:'label',
50
+
data: [
51
+
{
52
+
name:'input',
53
+
label:'Input'
54
+
},
55
+
{
56
+
name:'textarea',
57
+
label:'Textarea'
58
+
},
59
+
{
60
+
name:'file',
61
+
label:'File'
62
+
}
63
+
]
64
+
}
65
+
```
66
+
67
+
::: warning WARNING
68
+
If `url` property has been set, `data` content will be ignored and it will be uploaded from API.
69
+
:::
70
+
71
+
## `stringId`
72
+
*Boolean*, default **false**. Property can be specified if field `type` is **select**. Information, whether this field is non-numeric ID.
73
+
74
+
## `table`
75
+
*Boolean*, default: **true**. Responsible for displaying the field in the CRUD table.
76
+
77
+
## `text`
78
+
*String*. Field label (item details) and header (table). You can hardcode it or use i18n.
29
79
30
80
## `type`
31
81
*String*, optional. Type of field. Must be defined if `details` is set to **true**. You may use following types:
@@ -37,18 +87,57 @@ Parameters:
37
87
- datetime,
38
88
- textarea,
39
89
- file,
40
-
- select,
90
+
- select (this field uses `list`, `url`, `stringId` and `async` property),
41
91
- textarea,
42
92
- datePicker,
43
93
- richTextBox,
44
-
- checkbox
94
+
- checkbox,
95
+
- dynamic (this field uses `typeField` property),
45
96
46
-
## `list`
47
-
*Object*, optional. Field must be defined if field `type` is **select**.\
48
-
Parameters:
49
-
-`value`: primary key in select recordset,
50
-
-`text`: column with data to be displayed in the select field,
51
-
-`data`: [] (empty array)
97
+
## `typeField`
98
+
*String*, optional. Property must be defined if field `type` is **dynamic**. This field contains `name` of another field, which value determines this field's type. Example:
99
+
```js
100
+
fieldsInfo () {
101
+
return [
102
+
{
103
+
type:'select',
104
+
list: {
105
+
value:'name',
106
+
text:'label',
107
+
data: [
108
+
{
109
+
name:'input',
110
+
label:this.$t('fieldTypes.input')
111
+
},
112
+
{
113
+
name:'textarea',
114
+
label:this.$t('fieldTypes.textarea')
115
+
},
116
+
{
117
+
name:'file',
118
+
label:this.$t('fieldTypes.file')
119
+
}
120
+
]
121
+
},
122
+
stringId:true,
123
+
column:'type',
124
+
text:this.$t('fields.type'),
125
+
name:'type'
126
+
},
127
+
{
128
+
type:'dynamic',
129
+
typeField:'type',
130
+
column:'value',
131
+
text:this.$t('fields.value'),
132
+
name:'value'
133
+
}
134
+
]
135
+
}
136
+
```
52
137
53
-
## `grid`
54
-
*String*, optional. Vuetify grid used in extended details. This parameter is used to determine the field width on different screens.
138
+
## `url`
139
+
*String*, optional. Path to resource with list items. Property can be specified if field `type` is **select**.
140
+
141
+
::: tip INFO
142
+
If `url` and `path.default` property has been set in **src/config/api.js** file, only the rest of path is required.
0 commit comments