Button
Overview
Button is a simple yet functional component that allows you to call actions, add navigation options, and more. Buttons can be used as standalone components or as building blocks in other components, for example, a modal.

Properties
name
string
Component name
Methods
click
event?: any
void
Trigger click event. Optional event object can be passed
setDisabled
disabled: boolean
void
Disable or enable the component
setUrl
url: string
, queryParams?: object
void
Set the URL setting with optional query parameters
Triggers
On Click
Triggered when the component is clicked
On Init
Triggered when the component is initialized
Working with the component
In this section, we'll describe some of the most popular use cases of the Button component. Check them out below๐
Use case: Removing a user from the list
We have the following layout: a Table displaying the list of users and a Detail component showing the details of the selected user.
Add a Button to the canvas that will be used to remove users from the list.
Next, navigate to the Button's Triggers section and create a new action for the On Click trigger.
Configure the action in the following way:
First step:
Select your data source and the Delete Row action type.
In the Filters section, set the id that will be used to delete records:
{{ui.usersTableDetail.value.id}}
Second step - Add the Execute Action step and select your loadData action.
That's it! Now, when you click the Remove button, the selected user will be deleted from the list and the Table will show updated records.
Use case: Hiding a button based on condition
In some cases, you may need certain actions to be available only based on specific conditions. Let's say you have a list of users and you want the Reset password button to be shown only to the Admin. Here's how you can do that:
Add a Button to the canvas and give it a name, for example, Reset password.
Now, scroll down to the Show condition settings of the component in the right side panel.
In the Condition field, specify the required condition, for example,
{{user.role}} === 'admin'
.

Done! Now, the button will be hidden for all other users, except the ones with the Admin role.
Use case: Disabling a button based on condition
Another typical example is disabling a button based on a specific condition - for example, the Activate button that should be available only for users with the Inactive status.
Add a Button to the canvas and give it a name, for example, Activate.
Now, in the Button's settings, locate the Disabled field and select the Yes option there.
Next, switch to the field's JS mode to configure the condition:
{{ui.usersTableDetail.value.status == 'Active'}}
That's it! Now the button will be disabled for users which already have the Active status.
Use case: Adding navigation with a button
You can also check out the articles below for examples of using the Button component inside the Table๐
Last updated
Was this helpful?