⚡Event handlers
Last updated
Last updated
Within QuickDEV, event handlers fulfill the role of gathering and processing events originating from components and queries, subsequently executing subsequent actions. For instance, with a Button component, you can append an event handler to initiate the Run query action upon detecting a button Click event.
You can include multiple event handlers for a single component or query, and these handlers operate concurrently, offering flexibility in handling various interactions simultaneously.
Various components offer distinct events. For instance, Button components exclusively provide a Click event.
Queries can produce either successful or failed outcomes, thus presenting two events: Success and Failure. Within the Query editor, you can assign event handlers directly to queries.
In QuickDEV, there exists a variety of event handler actions tailored for diverse scenarios. You can configure these actions by selecting from the dropdown list labeled "Action" within an event handler.
Trigger the selected query.
To control a component, first select the component from the Component dropdown list, then proceed to choose one of its methods from the Method dropdown list.
Navigate to a QuickDEV app that supports query or hash parameters.
URL Query
Add ?key1=value1&key2=value2...
to the end of the URL of the app you intend to open.
URL Hash
Add #key1=value1&key2=value2...
to the end of the URL of the app you intend to open.
Navigate to an external URL.
Show a floating notification of informational, success, warning, or error message.
Copy a value to the clipboard
Export data in a certain file type (TXT, JSON, CSV and EXCEL).
An action can exclusively trigger under specific conditions. Set the running condition of an event handler within the "Only run when" option. The event handler will execute only when this condition evaluates to true
.
Debounce and Throttle reduce the frequency of triggering the action.
Debounce introduces a delay to an action. Upon setting a debounce time, the action will not execute immediately after the event occurs; instead, it will wait until the debounce time elapses. If the event reoccurs before the time ends, the debounce time will be reset. For instance, consider an input component that triggers a query when the user modifies the text. If running the query is resource-intensive and you wish to avoid executing it after every single character input, you can delay the query execution by setting a debounce time. Consequently, the query will only run after the user finishes typing.
Throttle limits an action to occur only once within a specified time span. By default, each event prompts an action, but in situations where executing an action is resource-intensive, throttle proves advantageous. For example, if you configure an event handler to initiate a "Run query" action for updating data upon a "Click" event, but realize that the query is too costly to execute frequently, you can establish a throttle time to ensure the query runs only once within the defined timeframe.