Top.Mail.Ru
Button
CTRL+K

Button

In this article
  • Button
  • Data Settings
  • Input Methods for Click Actions in the Button Widget
  • Display Settings
  • Activation Condition by Variable
  • Activation Condition by Formula
  • Widget Configuration in YAML
  • Data Settings in YAML
  • Display Settings in YAML
  • Example of a Configured Widget in the YAML Editor

The widget allows you to add a panel with buttons to the dashboard. When clicked, each button executes an assigned click action.

Button examples

Note

You can assign multiple actions to a single button. In this case, clicking the button displays a menu listing all added actions.

Data Settings

To configure the widget, add it to the view and click + Button in the right-side panel.

+ Button

You can specify a title and description for the widget. For each button, you can configure:

  • Name
  • Type: Primary, Secondary, or Link. The button’s visual appearance on the panel depends on its type Button type
  • Click actions
  • Display settings:
    • Button color (only for Primary type)
    • Text color
    • Border color (only for Secondary type)
    • Hint (text that appears on hover in browse mode); maximum length: 160 characters
    Button data configuration

To delete a button, click Delete.

Input Methods for Click Actions in the Button Widget

Available input methods depend on the selected click action:

  • Run the script:
    • Variable
    • From Data Model
    • Set by aggregation
    • Manual
    • Static list
    • Dynamic list
  • Update variable:
    • From variable
    • Set by aggregation
  • Open view:
    • Variable
    • Set by aggregation

When using Manual, Static list, or Dynamic list, a modal window appears upon clicking the Button in browse mode, prompting the user to enter or select parameters. To trigger the click action, make the required changes and click Run.

Additionally, when configuring the Run the script action with the Dynamic list input method, the Consider filters toggle is available. When enabled, the parameter receives data respecting filters applied in browse mode.

Note

Input methods cannot be used with the Go to the URL click action.

Display Settings

In addition to standard display settings, you can configure vertical and horizontal alignment for buttons inside the widget:

  • Vertical alignment: top, center, or bottom
  • Horizontal alignment: left, center, right, or full width

Button display settings

Additionally, when configuring the Run the script action, you can define button activation conditions — either by formula or by variable. If the condition is not met (e.g., the variable value is not in the selected list, or the formula evaluates to false), the button becomes disabled. When the Hide inactive button toggle is enabled, such a button is hidden in browse mode. This helps visually simplify the dashboard and prevent irrelevant elements from being shown to the user.

Activation Condition by Variable

You can restrict script execution access based on user role. For example, a script to recalculate the Data model should be available only to managers. To implement this:

  1. Create a User Role variable and define a list of roles (e.g., Operator, Manager, Head of Support).
  2. In the Run the script action, select activation by variable and specify which role values grant execution rights (e.g., Head of Support).
  3. Enable the Hide inactive button toggle.

Hiding inactive button by variable

As a result, in browse mode, the active button is displayed only to users with the selected roles; others will see an inactive button. In our example, a user with the Head of Support role will see the button.

Button display by variable

Users with other roles will see the inactive button.

Button hidden by variable

Activation Condition by Formula

You can configure button visibility based on a field’s value. For example, the Delete Comment button should only appear when a comment has already been added to the selected row. To implement this:

  1. Create a button and assign a Run the script click action (e.g., delete comment).
  2. In the action settings, define the activation condition by formula: comment field is not empty.
  3. Enable the Hide inactive button toggle.

Hiding inactive button by formula

In browse mode, the Delete Comment button appears only when selecting a row with a non-empty comment.

Button display by formula

If there is no comment, the button remains hidden.

Button hidden by formula

Widget Configuration in YAML

You can edit the widget not only in the view but also in the YAML editor. To add the widget, use the buttons block. The tables below list the keys and values used for configuration.

Data Settings in YAML

KeyTypeDefinition
namestringTitle
buttonTypeenumButton type:
- primary — Primary
- primary-outlined — Secondary
- link — Link
onClickClick action
hintstringHint for the button

Color Settings in YAML

To specify button and text colors, use the color block with the keys and values shown in the table.

KeyTypeDefinition
modeenumColoring mode:
- AUTO — Auto
- BASE — Solid
valuestringHEX color code

For secondary buttons, use the borderColor block with the same mode and value keys to set the border color.

Display Settings in YAML

KeyTypeDefinition
verticalAlignenumVertical alignment:
- TOP — Top
- CENTER — Center
- BOTTOM — Bottom
horizontalAlignenumHorizontal alignment:
- LEFT — Left
- CENTER — Center
- RIGHT — Right
- FILL — Full width

Example of a Configured Widget in the YAML Editor

  - key: button
    apiVersion: "17"
    type: BUTTON
    settings:
      buttons:
        - name: Refresh store list
          onClick:
            - type: UPDATE_VARIABLE
              name: Update variable
              variables:
                - inputMethod: VARIABLE
                  sourceVariable: Stores
                  name: Stores
          buttonType: primary
      horizontalAlign: LEFT
      verticalAlign: TOP
      sorting: []

Was the article helpful?

Yes
No
Previous
Text
We use cookies to improve our website for you.