Adding JavaScript Code to Tables
You can add JavaScript to tables using the Add button on the Table Display page in the Admin application. You can configure table filters of type Required only. The supported event handlers in this context are shown in the table below.
To add JavaScript to tables
- Start the Admin application.
- Click Table Display on the vertical navigation bar, and then click the table that you want to modify. The Table Display page opens showing the filters (if there are any) and columns that are configured for the table.
- Click the Add button under the Filters list.
- In the dialog box that opens, enter the following information.
- Type. Table supports JavaScript of type Required only.
- Label. This is a text field. Enter a label that describes the purpose of your configuration.
- Expression. Enter the JavaScript code in the Expression input box. Note that the event handlers must be the first methods mentioned in the inline JavaScript code in the Expression input box because the first methods are automatically registered as the event handlers. Any event handlers that are stored in libraries will not be called.
- Click Save.
The Table below describes the filter that you can configure for tables and shows the supported event handlers.
Table Display Filter Type | Description | Available Events |
Required | The Required context is typically used when the table is loaded to identify and modify the set of records available in table. | conditionQueryJSON excludeFromPreload |
For more information about JavaScript and table displays, see Using JavaScript Code to Filter Information in Swift MEAP