Adding JavaScript Code to Quick Selectors
You can add JavaScript code to individual quick selectors using the Add button on the Quick Selector page in the Admin application. You can configure filters of type Required or Validate for quick selectors. The supported event handlers are shown below.
To add JavaScript code to quick selectors
- Start the Admin application.
- Click Quick Selector on the vertical navigation bar, and then click the quick selector that you want to modify.
- In the section for Filters, you may either Edit or Add.
- In the dialog box that opens, enter the following information:
- Type. Quick selector currently support two contexts for JavaScript: Required or Validate.
- Select Required to configure conditions, exclusions, and filters for the quick selector.
- Select Validate to configure a Validate button for the quick selector.
- Label. This is a text field. Enter a label describing 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.
- Type. Quick selector currently support two contexts for JavaScript: Required or Validate.
- Click Save.
This Table describes the filters that you can configure for quick selectors and shows the supported event handlers.
Quick Selector Filter Type | Description | Available Events |
Required | The Required context is typically used when the quick selector list is loaded to identify and modify the set of records available in the quick selector list. | conditionQueryJSON excludeFromPreload |
Validate | The Validate context is typically used when the Validate button is selected in a quick selector list. | onValidateJSON |
For more information about JavaScript and quick selectors, see Using JavaScript Code to Filter Information in Swift MEAP.