Component methods
Last updated
Last updated
© 2024 UI Bakery
Component methods provide you with more flexibility when working with components. Using these methods, you can programmatically open and close components, set new or reset current values, and more.
Component methods are available under {{ui.componentName.methodName()}}
, and they can accept parameters and return values. You can see a list of component methods via the App state tab in the left side panel.
In this section, we'll explore two cases of using component methods.
When working with a Modal component, you may want it to open via custom interaction - on Button/Table row click or from a custom JavaScript snippet.
For this purpose, you simply need to add a Modal component to your working area and create a JavaScript Code action with the following code:
Now, let's review the case how you can reset a Form after creating a record and submitting your changes.
Add a Form to the working area.
Navigate to its Triggers section and select Create action for the On Submit trigger.
For the first step, select the Create Row action type.
Next, add another step to it of the JavaScript Code type and specify the following code:
Done! Now, after submitting the form, it will return to its default condition.