# Advanced Field Controls

# Target Audience

The target audience for this document is: Development and implementation personnel of this system

# Overview

This document describes some of the advanced field controls in this system, such as how to use the sub-table control.

# Sub-table Controller

The sub-table control is a special field control that can contain multiple data rows within one field, with each data row containing multiple fields. The display effect in CRUD forms is shown in the figure below:

Sub-table control in CRUD form

The display effect in wizards is shown in the figure below:

Sub-table control in wizard

# Definition

  1. When creating a dynamic field instance, set its display control to Sub table to use the sub-table control.
  2. When creating a form field, set its display control to Sub table to use the sub-table control.
  3. Under the display control configuration (DomainColumnClientSideTypeConfig) menu, you can configure a certain field of a domain to display as a sub-table control in all scenarios.

# Display Properties

The related properties of the sub-table are set in the extInfo of the dynamic field instance or form field. Details are as follows:

  1. The list of fields displayed in the sub-table is generally customized through an inline display form, which is set through the displayForm property in the extInfo of the sub-table field. The value of this property is the name of a form of type inline display form.

  2. Whether data rows in the sub-table can be created, edited, or deleted is set through the updatable, creatable, and deletable properties under extInfo.subTable of the sub-table field.

  3. You can set the sorting field for the sub-table, which is set through the sortBy property under extInfo.subTable of the sub-table field. If not set, it defaults to using a field named displaySequence as the sorting field.

Example as follows:

{
  /** ๅญ่กจไธญ็š„ๆ˜พ็คบๅญ—ๆฎตๅฎšไน‰็š„่กจๅ•ๅ */
  /** Name of the form defining the display fields in the sub-table */
  /**  Name of the form defining the display fields in the sub-table */
  "displayForm"?: "Form used to display the list of objects",
  /** ๅญ่กจๆŽงไปถ็š„็›ธๅ…ณๅฑžๆ€ง */
  /**  Related properties of the sub-table control */
  "subTable"?: {
    /** ๅญ่กจไธญๆ˜ฏๅฆๅฏๅˆ›ๅปบใ€็ผ–่พ‘ใ€ๅˆ ้™คใ€ๆœ็ดข็Žฐๆœ‰่กŒ */
    /**  Whether rows in the sub-table can be created, edited, deleted, or searched */
    "updatable"?: true | false,
    "creatable"?: true | false,
    "deletable"?: true | false,
    "searchModal"?: true | false,
    /** ๅญ่กจไธญ็š„ๆŽ’ๅบๅญ—ๆฎต๏ผŒ้ป˜่ฎคไธบ displaySequence, ๅฏไปฅ่ฎพ็ฝฎไธบๅ…ถไป–ๅญ—ๆฎต */
    /** Sorting field in the sub-table, default is displaySequence, can be set to other fields */
    "sortBy"?: "ๆŽ’ๅบๅญ—ๆฎต็š„ key" // Key of the sorting field
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

TIP

For creation or update forms, the save logic of the sub-table control occurs when the main object associated with the sub-table is saved. The platform has already implemented the update logic for sub-table data with a one-to-many data structure.

For wizards or action parameters, the frontend will submit the sub-table data as a property of the form. How the backend handles this depends on the customized Core Logic implementation of the wizard or action.

Last Updated: 9/29/2024, 2:33:14 AM