Grid: Add row(s)
See also: Grid: Fill, Grid: Clear, Grid: Remove row, Grid: Replace selected rows
Actions – Abstract
The action Grid: Zeile hinzufügen adds one or more rows from a Data grid linked as a Target element or one of the other List elements if the service configuration of the target element allows this
The action Grid: Zeile hinzufügen adds one or more rows from a Data grid linked as a Target element or one of the other List elements if the service configuration of the target element allows this.
►IMPORTANT◄ The specification of a target element from the group of List elements is required so that this action can be selected under Action type.
The rows to be added to the Target element must exist as input data ($input) for the action.
The Update if contained is set by default. This setting checks whether the corresponding data item is already contained in the Target element for each row to be added. If this is the case, the relevant entry in the Target element is updated with data from the $input. However, an object with identical content (for example, a copy of the original) is not considered a match.
If the Update if contained option is not set, the rows to be added are always added to the Target element as a copy.
Example
In connection with a truck transport, information on the vehicle type of the tractor truck is to be entered via the portal. The standard tractor trucks available in the company's own fleet are stored as options in a Combobox element (with the 'Options' display type). If necessary, it should also be possible to add data for non-standard tractor trucks 'spontaneously' – i.e. without creating additional master data. These should appear as an additional option in the Combobox element for the respective transport. If the relevant option is selected, the stored detailed data should be displayed again so that corrections can be made if necessary.
Runtime example:
Initially, the form offers three standard tractor truck types to choose from:
Clicking on the Additional type? Button displays a Column layout for entering details for an additional tractor truck type:
If the Column layout Non-standard-tractor contains valid data (here: all required fields are filled in), a click on the Submit Button adds the corresponding entry as an additional option for Tractor truck (type), then selects it and hides the Column layout Non-standard-tractor again:
The data structure of a tractor type in the Combobox element with the truck data field becomes clear with this addition in the structure export for the portal:
{
"truck"
: {
"type"
:
"FERRARI FYT"
,
"hp"
:
220
,
"registration"
:
"Y-123456"
}
}
The detailed data fields for 'Type' (type) and 'Power (HP)' (hp) are also used in the default entries that were entered in the example as 'Static values" in the service configuration for the Combobox element.
The required information 'registration number' (registration) is only used for non-standard tractor truck types, so that a value for this characteristic identifies the entry as 'non-standard type'. In the 'Label expression' within the service configuration, an attached asterisk appears, as shown in the screenshot (*).
Configuration:
|
For the Additional type? Button, next to the Tractor truck (type) Combobox, the behaviour shown on the left is configured to display and initialise the Column layout with the 'Non-standard-tractor' details:
|
|
For the 'Submit' Button in the Column layout for the definition of a 'Non-standard-tractor' the behaviour shown on the left is configured:
|