Writing hooks is a new premium feature that allows developers to customize the plugin’s behavior at specific, predefined spots. Hooks can be written using vanilla JavaScript or jQuery.
Currently, hooks are only available through the HOOKS menu tab in the Table Builder. They will be added to the Form Builder in future updates. Only administrators have the authorization to write hooks.
To view the list of available hooks, click the LIST OF HOOKS button at the top of the HOOKS panel. This overview is divided into three sections: app, table, and columns, with hooks displayed for each section.
To create a specific hook, click the plus icon next to the desired hook, which opens the code editor for that hook. Click the APPLY button directly below the code editor to activate an edited hook. Note that this action activates the hook but does not save it. To permanently save the hook, click APPLY or OK at the bottom of the screen.
Once a hook is created, two icons appear next to it:
- Power On/Off Icon: Temporarily disable the hook without deleting it.
- Visibility On/Off Icon: Toggle the hook’s visibility in the menu.
To permanently delete a hook, use the DELETE button below the hook. The REVERT button reverts the hook to the state of the last APPLY action.
Error Handling and Safe Mode #
Because developers are more likely to introduce bugs than features, hook execution includes thorough exception handling to prevent app crashes. However, an app may still enter a failed state where it can no longer start. In such cases, you can use the App Manager to enable safe mode, which disables all hooks, allowing you to fix any bugs.
Return Values for Hooks #
Many hooks expect a return value, which can be one of the following:
- Template literal
- DOM element
- jQuery object
When creating a hook, a JavaScript template is provided. Please note that headers and footers are not editable. A placeholder indicates where you should enter your code.