Events and Interactivity
Events in Superblocks Applications function the same as events in other programming languages, such as JavaScript. That is, events notify the application of changes in the system to which developers can define how the application reacts accordingly. Examples of events in Superblocks include:
- Loading a page
- User interactions with frontend components (clicking a button, typing into a text input, etc)
- Completion of backend APIs
- Timers firing to execute actions on timed intervals
- Custom events defined and triggered by the user
Event handlers allow you to define the logic for how your application responds to these events, through a series of actions. These actions can be used to run your APIs, execute custom JavaScript, navigate to another application, and even trigger other events with their own set of event handlers and actions.
As a basic example, here an application allows a user to click a button in a table row to open a modal with a detailed view.
This also demonstrates how events can be chained together, where an action based on one event can trigger another event and so on. In this case, the second event is the modal opening, which triggers its onOpen
event handler, which performs the action of running an API to populate the shipping history.
Additional resources
To learn more about events and event handlers, see the resources below.