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
Copy file name to clipboardExpand all lines: src/configuration/ThemesConfiguration.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ The format of the theme definitions is as follows:
199
199
|`"extraPrintParameters": "<&KEY=VALUE>",`| Optional, additional query parameters to append to GetPrint request (requires QGIS Server >= 3.32.0). |
200
200
|`"extraPrintLayers": ["<layername>", ...],`| Optional, extra list of layers to mark as internal print layers, i.e. which are omitted from the QWC2 LayerTree. |
201
201
|`"printLabelBlacklist": ["<LabelId>", ...]`| Optional, list of composer label ids to not expose in the print dialog. |
202
-
|`"editConfig": "<editConfig.json>"`| Optional, object or path to a filename containing the editing configuration for the theme, see [Editing](#editing). |
202
+
|`"editConfig": {<editConfig>}`| Optional, object containing the editing configuration for the theme, see [Editing](#editing). |
203
203
|`"snapping": {...},`| Optional, snapping configuration, see [Snapping](../topics/Snapping.md). |
204
204
|`"flags": ["<flag1>", "<flag2>", ...],`| Optional, list of arbitrary flag names. The visibility of menu items, toolbar items and map buttons can be controlled based on the flags a theme declares. See [Plugin Configuration](ViewerConfiguration.md#plugin-configuration). |
205
205
|`"config": {`| Optional, per-theme configuration entries which override the global entries in `config.json`, see [Viewer Configuration](ViewerConfiguration.md).|
Copy file name to clipboardExpand all lines: src/topics/Editing.md
+26-14Lines changed: 26 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,19 @@ In a manually created Qt-Designer Ui form, you can use key-value relations for c
63
63
64
64
For `Autogenerated` and `Drag and Drop Designer` forms, configure the 1:N relation in QGIS Project → Properties → Relations. Note that the child table foreign key must refer to parent primary key.
65
65
66
-
By default, a table widget similar to an attribute table will be generated to manage the relation values. If you set `generate_nested_nrel_forms` to `true` in the config generator config, the relation values will be displayed as a list of buttons which open the record in a nested form. The button label is chosen according to the following rules:
66
+
By default, a table widget similar to an attribute table will be generated to manage the relation values. You can switch to a list of child entries which, when clicked, are displayed in a nested form by setting `generate_nested_nrel_forms` to `true` as follows:
67
+
68
+
* In the toplevel `config` section of the `tenantConfig.json`. This will apply globally to all datasets.
69
+
* In the `editConfig` section of a theme in `themesConfig.json` (see also [`editConfig`](#edit-config) below). This will then apply only to the respective dataset. Example:
70
+
```
71
+
"editConfig": {
72
+
"<LayerId>": {
73
+
"generate_nested_nrel_forms": true
74
+
}
75
+
}
76
+
```
77
+
78
+
The label of the entry in the child entry list is chosen according to the following rules:
67
79
68
80
* The display name (Layer properties → Display → Display Name) of the referencing layer, if the expression is a single field name.
69
81
* The primary key value of the referencing layer.
@@ -119,15 +131,8 @@ The `qwc-data-service` offers some basic functionality for logging mutations:
119
131
120
132
*Note*: for these fields to be written, ensure the qgis project is also up-to-date, i.e. that contain the up-to-date table schemas. You can set the respective field types to hidden in the QGIS layer properties to avoid them showing up in the autogenerated edit forms.
121
133
122
-
123
-
## Using a custom editing backend
124
-
125
-
You can also use a custom editing backend instead of the `qwc-data-service` by following these steps:
126
-
127
-
- Implement the custom editing interface, taking [default `EditingInterface.js`](https://github.com/qgis/qwc2/blob/master/utils/EditingInterface.js) as a template.
128
-
- Enable the desired editing plugins in [`js/appConfig.js`](https://github.com/qgis/qwc2-demo-app/blob/master/js/appConfig.js), passing your custom editing interface to `Editing`, `AttributeTable` and `FeatureForm`.
129
-
- Set up an editing backend.
130
-
- If you are using the [`qwc-config-generator`](https://github.com/qwc-services/qwc-config-generator), the edit configuration will be automatically generated from the QGIS project. Otherwise, you need to write a custom `editConfig` in `themesConfig.json` as follows:
134
+
## The theme `editConfig` block<aname="edit-config"></a>
135
+
The [`qwc-config-generator`](https://github.com/qwc-services/qwc-config-generator). will automatically generate the `editConfig` for a theme in `themesConfig.json`. You can however also specify it manually, in which case the manually defined entries will be merged with the automatically generated entries. The structure of the `editConfig` block is as follows:
@@ -136,7 +141,7 @@ You can also use a custom editing backend instead of the `qwc-data-service` by f
136
141
|` "layerName": "<LayerName>",`| The layer name to show in the selection combo box. |
137
142
|` "editDataset": "<DatasetName>",`| The name of the edit dataset passed to the editing interface. |
138
143
|` "geomType": "<GeomType>",`| The geometry type, either `Point`, `LineString` or `Polygon`. |
139
-
|` "displayField": "<FieldId>",`| The ID of the field to use in the feature selection menu. |
144
+
|` "displayField": "<FieldId>",`| The ID of the field to use in the feature selection menu. |
140
145
|` "permissions": {`| A list of different write permissions to specify rights and buttons. |
141
146
|` "creatable": <boolean>,`| If `true`, `Draw` button will appear in Editing interface and `Add` button in Attribute Table. |
142
147
|` "updatable": <boolean>,`| If `true`, `Pick` button will appear in Editing interface. |
@@ -151,9 +156,16 @@ You can also use a custom editing backend instead of the `qwc-data-service` by f
151
156
|` ...`| For regular HTML input types, the ReactJS API name of any applicable [HTML input constraint](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), i.e. `maxLength` or `readOnly`. |
152
157
|` }`||
153
158
|` }],`||
154
-
|` "form": "<PathToUiFile>",`| Optional, a QtDesigner UI file. |
159
+
|` "form": "<PathToUiFile>",`| URL to a Qt Designed UI form (use `:/<path>` to specify a path below the `assets` folder).|
160
+
|` "generate_nested_nrel_forms": <boolean>`| Optional: Tell the config-generator whether 1:N relations of this dataset should be displayed in nested forms. |
155
161
|` }`||
156
162
|`}`||
157
163
158
-
* If you specify just `fields`, a simple form is autogenerated based on the field definitions.
159
-
* Alternatively you can specify the URL to a Qt Designer UI form in `form` (use `:/<path>` to specify a path below the `assets` folder).
164
+
165
+
## Using a custom editing backend
166
+
167
+
You can also use a custom editing backend instead of the `qwc-data-service` by following these steps:
168
+
169
+
- Implement the custom editing interface, taking [default `EditingInterface.js`](https://github.com/qgis/qwc2/blob/master/utils/EditingInterface.js) as a template.
170
+
- Enable the desired editing plugins in [`js/appConfig.js`](https://github.com/qgis/qwc2-demo-app/blob/master/js/appConfig.js), passing your custom editing interface to `Editing`, `AttributeTable` and `FeatureForm`.
0 commit comments