Grid: Remove row

See also: Grid: Fill, Grid: Clear, Grid: Add row(s), Grid: Replace selected rows

Actions – Abstract

The action Grid: Remove row removes 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: Remove row removes 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.

images/download/attachments/189433968/image-2024-10-10_15-27-14-version-1-modificationdate-1728566834751-api-v2.png

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 row(s) to be deleted from the Target element must exist as input data ($input) for the action. A target row is deleted if the associated data item is identical to the input data or is contained in a list of objects passed. The transfer of another data item (e.g. a copy) with identical content is not accepted.

Suitable input data provides, for example, behaviour types Selected item of grid or Selected items of grid respectively, or triggers like Item selected or Item click. However, depending on the type of Target element and its configuration, it must be noted that the 'selected rows' may represent the value of the element, while the action Grid: Remove row always removes rows from the list that is the basis for a selection. The selection itself remains even if the underlying list entry is removed. Therefore, removing a selection option at runtime may have no visible effect unless the rows removed from the list are also 'deselected'.

Example

For a truck transport, a suitable Crew should be assembled based on available candidates in a certain Driving staff pool. Within the crew, the role of Drivers and Assistants must be filled. Multiple allocations should be possible.

Assigned candidates should be removed from the Driving staff pool selection list, so that contradictory assignments (within the same crew) are excluded.

Runtime example:

images/download/attachments/189433968/image2020-7-7_15-32-51-version-1-modificationdate-1728565897613-api-v2.png

  • From a Driving staff pool (left) with four candidates originally (with the B or B/C 'License') a 'Driver' has already been assigned for the Crew in the image.

  • The role to be assigned within the Crew is determined via the centrally positioned Combobox element with the two options Drivers and Assistants.

  • An assignment is triggered by clicking on one of the entries in the Driving staff pool data grid. The clicked 'row' is then removed on the left and added to the chosen Data grid ('Driver' or 'Assistant') on the right.

Configuration:

images/download/attachments/189433968/image-2024-10-10_15-36-53-version-1-modificationdate-1728567413816-api-v2.png

For the Driver staff pool Data grid, two similarly structured behaviours are configured for assigning a candidate as 'Driver' or 'Assistant'. As an example, the 'pickAssistant' behaviour concerning the 'Assistant' is discussed below:

  • The behaviour reacts to the Triggering event Item click, which provides the data object with the clicked entry as input data ($input).


  • The Behaviour type Filled with checks the linked Combobox element, here on the key value assistant for the option 'add to Assistants'.


  • Under the Actions on 'true' the action Grid: Add row(s) (collapsed in the picture) performs the actual assignment of an assistant, while the action Grid: Remove row with the Target element 'Driving staff pool' ensures that the assigned 'Assistant' is removed from the 'Driving staff pool'.

NOTE◄ The action Grid: Remove row could also be used in a mirrored approach to remove assigned 'Drivers' and 'Assistants' when the Item click is clicked from the respective Data grid elements. However, the action Grid: Add row(s) should then also be executed to add these options to the 'Driving staff pool' again.