Difference between revisions of "GUI Callbacks"
Jonny Morris (talk | contribs) |
Jonny Morris (talk | contribs) |
||
Line 2: | Line 2: | ||
Callbacks run code on a process performing a defined action. | Callbacks run code on a process performing a defined action. | ||
=Table Callbacks= | =Table Callbacks= | ||
+ | ==onCellClicked(column, val, rowvals)== | ||
+ | This callback gives the user the flexibility to add personalized options when a cell is clicked. | ||
+ | For example, the following three commands will give you a pop-up message box stating the column name, cell value or all the row values with their corresponding column names: | ||
+ | |||
+ | '''session.alert(column);'''/n | ||
+ | '''session.alert(val);'''/n | ||
+ | '''session.alert(rowvals);'''/n | ||
=Custom Callbacks= | =Custom Callbacks= |
Revision as of 15:17, 16 November 2021
Overview
Callbacks run code on a process performing a defined action.
Table Callbacks
onCellClicked(column, val, rowvals)
This callback gives the user the flexibility to add personalized options when a cell is clicked.
For example, the following three commands will give you a pop-up message box stating the column name, cell value or all the row values with their corresponding column names:
session.alert(column);/n session.alert(val);/n session.alert(rowvals);/n
Custom Callbacks
onAsyncCommandResponse(response)
tbc
onKey(keyEvent)
This callback is triggered on most keystrokes from the keyboard, however there are some keys that this does not apply too, shift, ctrl, and esc for example. It is overridden by any field that has its own onKey callback. For example, the text field in a html field panel will not trigger this callback when the user types in this field however the filter box for a table will trigger this callback as there are no callbacks on a filter field as standard.
keyEvent
The key event is an object that contains the key object. This object holds the key that was pressed.
onNoificationHandled(id,status.attachment)
tbc
onStartup()
onUserPrefsLoaded(userPrefs)
This callback is triggered when user preferences are in the process of being loaded. This could be when the user first presses the save button to begin the update of their default timezone.
onUserPrefsLoading(userPrefs)
This is triggered when user preferences are in the process of being saved. This could be when the user first presses the save button to begin the update of their default timezone.
onUserPrefsSaved(userPrefs)
This is triggered when user preferences are successfully saved, this could be the user updating their default connection timeout.
onUserPrefsSaving(userPrefs)
This is triggered when user preferences are in the process of being saved.
userPrefs
This object contains a list of all user preferences.
HTML Field Callbacks
onChange()
This is triggered when the state of the field is changed, this could be pressing a button or pressing a key in a text box.
onFocus()
This callback will run the provided script when the current element becomes active, this could be for example ‘tabbing’ or clicking into a text box.
Divider Callbacks
onDividerMoved(offsetPct, offsetPx)
This callback is triggered when a divider is clicked, moved, and dropped in a new location by the user. This does not trigger if the user clicks the divider but doesn’t move it.
onDividerMoving(offsetPct, offsetPx)
This callback is triggerd as soon as the divider is moved regardless of whether the user drops the divider, this is repeatedly triggered on every move the divider makes.
offsetPct
This gives a percentage for the offset value for the divider in relation to the divider to its left in vertical dividers and the divider above it in horizontal dividers.
offsetPx
This gives the offset value for the divider in pixels in relation to the divider to its left in vertical dividers and the divider above it in horizontal dividers.