A tab list belongs to the Interact category. It allows you to dynamically display tabs in your DataV project by using interaction events with other widgets. You can configure the color, quantity, type, and style of the tabs. This topic describes the configuration items of a tab list.

Settings

  • Search for Configurations: In the right-side panel of Canvas Editor, click the Settings tab, and click Search for Configurations in the upper-right corner. Enter the required configuration item in the search box, and click the search icon to quickly locate the configuration item. Fuzzy match is supported. For more information, see Search for widget configuration items.
  • Size: indicates the size of a widget, including its pixel width and height. You can click the Proportional resizing icon to proportionally adjust the width and height of a widget. After you click this icon again, you can adjust the width and height as needed.
  • Position: the position of a widget, which is indicated by pixel X and Y coordinates. X-coordinate indicates the pixel distance between the upper-left corner of the widget and the left border of the canvas. Y-coordinate indicates the pixel distance between the upper-left corner of the widget and the upper border of the canvas.
  • Rotation Angle: the angle of a rotation that uses the center point of a widget as the rotation point. The unit is degrees (°). You can use one of the following methods to control the rotation angle of a widget:
    • Directly enter the degrees in the Rotation Angle spin box or click the plus sign (+) or minus sign (-) to increase or decrease the value in the Rotation Angle spin box.
    • Drag the black dot in the Rotation control icon icon.
    • Click the Horizontal flip icon to horizontally flip a widget.
    • Click the Vertical flip icon to vertically flip a widget.
  • Opacity: the opacity of a widget. Valid values: 0 and 1. If this parameter is set to 0, the widget is hidden. If this parameter is set to 1, the widget is completely displayed. Default value: 1.
  • Font: the font of the tab list.
  • Background Color: the background color of the tab list.
  • Rows: the number of rows in the tab list.
  • Columns: the number of columns in the tab list.
  • Selection Type: the selection type of the tab list. Valid values: Single Selection and Multiple Selection.
  • Carousel: the carousel interval of the tab list. Click the Eye icon icon to enable or disable the carousel.
  • Tab Selected During Initiation: the ID of the tab to be initially selected. The value of this parameter must be the same as the value of the id parameter on the Data tab. If Selection Type is set to Single Selection, you can enter only one value. If Selection Type is set to Multiple Selection, you can enter multiple values. Separate the values with commas (,).
    Figure 1. Selection Type set to Single Selection
    Selection Type set to Single Selection
    Figure 2. Selection Type set to Multiple Selection
    Selection Type set to Multiple Selection
    Figure 3. Initial Value of the Tab List
    Initial value of the tab list
  • All Button: specifies whether to display the ALL tab. This parameter appears only when Selection Type is set to Multiple Selection. All Button
  • All Tabs Selected During Initiation: specifies whether to select all tabs by default. If you turn on the switch, the Tab Selected During Initiation parameter does not appear. This parameter appears only when Selection Type is set to Multiple Selection. All Tabs Selected During Initiation
  • Default OptionsDefault Options
    Parameter Description
    Font size The font size of the tabs.
    Font Color The font color of the tabs. For more information, see Color picker.
    Font Weight The font weight of the tabs.
    Background Color The background color of the tabs.
    Border Radius The corner radius of the tabs. A larger value indicates more rounded corners. Default value: 0. This value indicates that the tabs are rectangles.
    Hover Color The background color of a tab when you move the pointer over the tab. You can view the configuration effect only on the preview or publish page.
    Select Text Color The text color of the selected tabs.
    Select Background Color The background color of the selected tabs.
    Icon Configuration The width, height, and position of the tab icon, as well as the distance between the icon and text.
  • Callback ID: the variable used to associate data between widgets. The callback ID must be a parameter configured on the Data tab.
    Notice If the version of your widget is not the latest, upgrade the widget xxx xxx and configure callback IDs in the Interaction tab.

Data

data

The following figure shows sample data:

[
  {
    "id": 1,
    "content": "TAB1"
  },
  {
    "id": 2,
    "content": "TAB2"
  },
  {
    "id": 3,
    "content": "TAB3"
  }
]
Table 1. Parameters
Log field Description
id The ID of a tab. The Tab Selected During Initiation parameter on the Setting tab defines the ID of the default selected tab based on this parameter.
content The text on a tab.
Table 2. Parameters
Parameter Description
Controlled Mode If you turn on the switch, data is not requested when a widget is initialized. Data requests are triggered only based on callback IDs or the method configured in Blueprint Editor. If you turn off the switch, data requests are automatically triggered. By default, the switch is turned off.
Auto Data Request After you select the Auto Data Request check box, you can enable dynamic polling, and manually specify the polling interval. If you do not select this check box, data is not automatically requested. You must manually refresh the page to request data or use Blueprint Editor or callback ID events to trigger data requests.
Data Source In the right-side panel of Canvas Editor, click the Data tab. Click Set next to Static Data. In the Configure Datasource panel, select a data source from the Data Source Type drop-down list. Enter code for data query in the code editor, click Preview Data Response to preview the response of the data source, and then view the response. For more information, see Configure widget data.
Data Filter If you select the Data Filter check box, you can convert the data structure, filter data, and perform simple calculations. If you click the plus sign (+) next to Add Filter, you can configure the script for the data filter in the editor that appears. For more information, see Use the data filter.
Data Response Result The response to a data request. If the data source changes, you can click the Refresh icon icon next to Data Response Result to view the data response in real time.

Interaction

Select the Enable check box to enable interactions between widgets. When you click a tab, a data request is triggered to pass callback IDs to dynamically load data. By default, the id and content parameters are passed. For more information, see Configure a callback ID.

Configure interactions in Blueprint Editor

  1. In Canvas Editor, right-click a widget in the Layer panel and select Add to Blueprint Editor.
  2. Click the Blueprint Editor icon icon in the upper-left corner of the page.
  3. In the blueprint editor, click Tab List in the Added Nodes pane. You can configure the widget parameters on the canvas. lantu
    • Event
      Event Description
      On Completion of Data Interface Request The event is triggered with the processed JSON data after a data interface request is responded and processed by a filter. For specific data, see Data.
      On Failure of Data Interface Request The event is triggered with the processed JSON data after a data interface request is failed and processed by a filter. For specific data, see Data.
      On clicking a tab When you click a tab, this event is triggered to pass data of the tab.
    • Action
      Action Description
      Request Data Interface This action is performed to request the server data again. The data sent by an upstream converter or layer node is used as a parameter. For example, the tab list uses the API data source http://api.test, and the data passed to the Request Data Interface action is { id: '1'}. As a result, the http://api.test? id=1 API is called to request data.
      Import Data Interface After data of a widget is processed in accordance with its drawing format, the widget is imported for redrawing. You do not need to request server data again. For specific data, see Data.
      Select Tabs This event selects one or more tabs and needs input of an array or object.
      Enable carousel This action enables the carousel for the tab list.
      Disable carousel This action disables the carousel for the tab list.
      Select or Deselect All This action selects or deselects all tabs.
      Update Widget Configurations Style configurations of widgets are dynamically updated. Before this action is executed, you must click the widget in Canvas Editor, click the Settings tab in the right-side panel, and click Copy Configurations to... to obtain widget configurations. Then, paste the data to the box of a data processing node in the blueprint editor and configure the field values.
      Show A widget is shown without the need to specify parameters.
      Hide A widget is hidden without the need to specify parameters.
      Hide/Show A widget is hidden or shown.
      Move

      A widget is moved to a specified location. The following example shows the reference data.

          {
            // The positioning type. to indicates absolute positioning, whereas by indicates relative positioning. The default value is to. 
              "positionType": "to",
            // The location, which is indicated by the x and y coordinates. 
            "attr": {
              "x": 0,
              "y": 0
            },
            // The animation type. 
            "animation": {
              "enable": false,
              // The duration in which animation is displayed. 
              "animationDuration": 1000,
              // The animation curve, which can be set to linear|easeInOutQuad|easeInOutExpo. 
              "animationEasing": "linear"
            }
          }