Input Box

更新时间:
复制 MD 格式

The input box widget lets users enter content and submit it for backend processing via a button click.

Component overview

An input box is a control widget consisting of a content input area and a submission button. You can enter content in the input area and click the button to submit it for backend processing. image

Scenarios

Input boxes are commonly used in visualization applications as input forms for quick and accurate data entry or retrieval, such as registration and login verification or product search interfaces.

Effect display

image

Prerequisites

Add input box

  1. Access the DataV console.

  2. On the Workbench page, in the Data Dashboards area, hover over the target dashboard and click Edit. The canvas editor opens.

  3. In the left-side navigation pane, under the Component Library > Information list, click the Input Box widget to add it to the canvas.

You can also use global search to add related widgets.

Integrate business data

After adding the widget, integrate your business data for display. Click the input box and select the data to render on the right-side Data Source tab. image

  • The input box accepts the following data fields.

    Field

    Description

    value

    The content that is displayed by default in the content input area of the input box. If not empty, it will overwrite the configuration in the style. If empty, it will use the content in the Style > Input Box > Placeholder Text configuration item.

    The following example shows the data structure and effect of a sample input box.

    [
      {
        "value": "Please enter your content..."
      }
    ]

    image

  • This section describes the core configuration items for the data source.

    Configuration

    Description

    Select Data Source

    Supports various data types, such as CSV files, APIs, and different databases. For more information, see Supported data source types. Edit data fields in a visual table or in code.

    Configure Filter (Optional)

    Customize filter code to transform, filter, display, and perform simple calculations on data. For more information, see Manage data filters.

    Configure Data Mapping

    Map fields from the selected data source to the widget's fields. This enables real-time data matching. Click the image icon to configure field styles.

    View Response Result

    Displays the data connected to the widget in real time. When the widget's data source changes, this section shows the latest data.

    • Click the data response result to view the data field code.

    • Click View Example to see the array type and sample code that the data source accepts. You can write your fields based on the example.

    Other data request configurations:

    • Disable Loading State: If you check this box, the widget's initial loading content does not appear when the widget updates or when you preview the data dashboard.

    • Controlled Mode: If you check this box, the widget does not request data when it initializes. Data requests can only be started by the blueprint editor or by global variable events.

    • Auto Update Request: If you check this box, the platform polls for data updates at the interval you set. If you do not check this box, you must refresh the page manually or use the blueprint editor or global variable events to trigger data updates.

Configure input box

Click the input box widget to access configuration options on the right-side panel, including basic style, global variables, interaction occurrences, advanced settings, and blueprint interaction.

Style configuration

On the Style panel, configure the background color, placeholder text, border, and other styles of the input box.

Note

You can also click the image icon to quickly find configuration items by keyword search, which supports fuzzy match. For more information, see Search Configuration Items.

The following table describes the configuration items.

Configuration item

Description

Illustration

Global configuration

Defines the widget's position, transparency, and interaction passthrough in the data dashboard.

  • Opacity: The smaller the value, the more transparent the widget. The value ranges from 0 to 1.

  • Interaction Passthrough: If you turn this on, mouse events pass through the widget. This is useful when many widgets are on the dashboard and you need to interact with widgets in lower layers.

image

Input box configuration

Configures the background color, border style, text content, margin between text and border, and text style of the input box.

  • Margin: The distance between the text and the left and right borders.

  • Placeholder text: The placeholder text content displayed in the input box, which can also be configured in the data source.

    Note

    The configuration content in the data source has a higher priority than the current configuration item. If the data source content is empty, the current configuration content will be used.

  • Text style: You can set the font, weight, font size, color, and font style of the text.

    • Font: Please select a font that is already installed on your system. If the font is not installed on the system, the text will be displayed in the default font. For more font information, see Font Library.

    • Font styles include the following:

      • Normal: Normal style.

      • Italic: Italic style.

      • Oblique: Used to set text that cannot be displayed in italics to an oblique style. For example, some fonts may not have an italic style, so you can use Oblique to tilt the text.

  • Border style: You can set the line type, color, thickness, and angle of the border.

image

Button configuration

Defines the button type of the widget as text or icon, and the display style of the button in different states. image

  • Text button: You need to configure the text content, button frame width, border line, color, thickness, border radius, and text font, font size, color, font style, and other content.

    Important

    If the button width is set too small, it may cause the button text to overflow.

    • Font: Please select a font that is already installed on your system. If the font is not installed on the system, the text will be displayed in the default font. For more font information, see Font Library.

    • Font styles include the following:

      • Normal: Normal style.

      • Italic: Italic style.

      • Oblique: Used to set text that cannot be displayed in italics to an oblique style. For example, some fonts may not have an italic style, so you can use Oblique to tilt the text.

  • Icon button: You need to configure the icon color and icon size and other styles.

  • Button display styles include the following:

    • Normal style: The style presented by default by the button.

    • Click style: The style presented when the mouse clicks the button.

    • Hover style: The style presented when the mouse hovers over the button.

    Note

    The button configuration in different styles can refer to the above text button/icon button configuration details.

image

Advanced configuration

Configure how the input box interacts with other widgets.

Configuration item

Description

Illustration

Interaction occurrences

Defines the interaction behavior with other widgets to achieve widget linkage. Click the image icon to define related interaction occurrences and interaction actions.

image

Associate global variables

You can associate global parameters in the widget to achieve parameter transmission between widgets and perform widget interaction. Click the image icon to enable the corresponding instruction and associate the required global variables for the instruction.

By changing the text content of the input box or clicking the widget button, trigger a data request, and throw the value value configured in the data source panel. For configuration details, see Widget interaction configuration.

Blueprint interaction

Use the Blueprint Editor to visually define the interaction relationships and behavior logic between widgets.

Procedure

  1. On the canvas editing page, click the image icon at the top left of the menu bar to enter the Blueprint Editor.

  2. In the layer node list, hover over the input box widget and click the image icon to add the widget to the main canvas.

  3. Configure the blueprint interaction effects for related widgets as needed using the connection method.

    Here is an example. image

Configuration item introduction

The following table describes the available interaction occurrences and actions.

Note

Click the image icon next to the occurrence or action in the blueprint configuration interface for a detailed description of the related parameters.

Category

Subcategory

Description

Event

When Data Is Updated

This occurrence is thrown when the widget data is updated.

When Request Status Changes

This occurrence is thrown when the data request status changes. The status values include Void, Loading, Success, Error.

When Current Value Changes

This occurrence is thrown when the current value changes, and the data item corresponding to the value is also thrown. The data example is as follows.

{
  "value": "Input box content"
}

When Button Is Clicked

This occurrence is thrown when the button is clicked, and the data item corresponding to the value is also thrown. The data example is as follows.

{
  "value": "Input box content"
}

Action

Import Data

After processing the data according to the widget rendering format, import it into the widget and re-render it. There is no need to request server data again. The data example is as follows.

[
  {
    "value": "Input box content"
  }
]

Request Data

Request server data again. The data thrown by the input data processing node or layer node will be used as a parameter. For example, if the API data source configured for the input box is https://api.test, and the data passed to the Request Data action is { id: '1'}, the final request will be https://api.test?id=1.

Obtain Current Input Box Value

Obtain the current value of the input box.

Revert Component To Default Value

Revert to the default value of the widget.

Shift

Moves the widget to a specified position. The following code shows a data example.

{ 
  // Movement type. Absolute positioning: to, relative positioning: by. Default: to.
    "positionType": "to",
  // Specified position. x-coordinate, y-coordinate.
  "attr": {
   "x": 0,
   "y": 0
   },
  // Animation method.
  "animation": {
    "enable": false,
    // Animation duration.
   "animationDuration": 1000,
    // Animation curve. Optional values: linear|easeInOutQuad|easeInOutExpo.
   "animationEasing": "linear"
  }
}

Switch Visibility

Toggles the widget's visibility between shown and hidden. The following code shows a data example.

{
  "animationType": "fade",
  "animationDuration": 1000,
  "animationEasing": "linear"
}
  • animationType: The animation method. You can set this to appear (appear/disappear), fade (fade in/fade out), or slideToUp (fly in/fly out). If not configured, there is no animation.

  • animationDuration: The animation duration. The default is 1000 ms.

  • animationEasing: The animation curve. You can set this to linear (constant speed), easeInOutQuad (smooth), or easeInOutExpo (slow-fast-slow).

Show

Hide

Update Widget Configuration

Dynamically updates the widget's style configuration.

  1. On the widget's Style panel, click Copy Configuration to Clipboard to get the widget's configuration data.

  2. In the data processing node on the blueprint editor's configuration page, change the field values for the corresponding styles as needed.