This topic describes control configurations, including the configuration rule and common fields.
Rule configuration
Configurations of a control consist of common and custom fields. For more information, see Configure general settings..
For example, in the following example, name, type, and default are common configurations, and prefix are private configurations.
{
"name": "Text Box",
"type": "text",
"default": "",
"description": "Description and Label",
"prefix": "Today's progress: "
}Configure general settings.
| Field name | Element | Type | Required | Remarks |
|---|---|---|---|---|
name | The name of the control. | string | Yes | Example value: Text Box. |
type | Type | string | Yes | Example value: text. If this field is set to hidden, DataV does not render the control. |
default | The default value of the control. | string, number, object, or array | No | The dimension. |
showInPanel | The rule to display the control on the panel. | string | No | If you do not specify this field, the control is displayed on the panel. If you specify this field, the control is displayed based on the rule. For more information, see Configuration of the showInPanel field. |
caption | The label of the control. | string | No | If this field is not configured, the label is not displayed. |
description | Description | string | No | The dimension. |
handler | The processing function name. | string | No | The dimension. |
col | The number of grids for the control. | number | No | The 24-grid system is used. |
valuePath | The value path of the control. | string | No | For more information, see Configuration of the valuePath Field. |
| show | Display and hide of elements | object | No | The following sample code provides configuration examples.
|
Custom fields
The custom fields for different controls vary. For more information, see Control configurations.