Client Menus
Last updated
Last updated
Opens a customisable menu or form. A menu can be used whilst moving around whilst a form takes full control of the users UI.
Parameter | Required | Type | Description |
---|---|---|---|
Can handle any element data apart from type. See Menu Element Object for the element structure. Only name is required and it will only update the fields that are provided.
Can handle any element. Used to remove an element from a form.
These use direct callbacks based on the menu type. You will need to use TMC.Functions.RegisterUiHandler instead of callbacks.
Close any open side menu
In order to receive event updates for the side menu you can register UI handlers. These handlers will be triggered when the side menu changes them.
When registering a handler you will need to prepend your menuRef
to the handler.
I.e. to register a handler for a control click with a menu type of clothing
you would do:
Available events for side menu:
Can add an element to an open side menu. See Side Menu Element Object for the element structure.
Can handle any element data apart from type. See Side Menu Element Object for the element structure. Only name is required and it will only update the fields that are provided.
Remove an element from the side menu. Requires only the name of the element.
Can handle any category data. See Side Menu Category Object for the category structure. Only name is required and it will only update the fields that are provided.
Update the current visible tab. Force the user to switch onto another tab. Requires the category name.
Parameter | Required | Type | Description |
---|---|---|---|
settings
An object containing settings for the form
elements
A list of elements to include on the form
closeHandler
Function
A function that gets triggered when the menu is closed.
selectHandler
Function
A function that gets triggered when using a menu and the highlighted field is modified.
changeHandler
Function
A function that gets triggered when a value within the form gets changed or a button element is pressed.
menuRef
String
Reference to the side menu which events should be triggered for.
categories
An array of category definitions.
elements
An array of element definitions.
controls
An array of control definitions
disableCancel
Bool
Disable the cancel button.
closeOnly
Bool
Hides both Confirm
and Cancel
buttons and puts a Close
button in it's place.
initialTab
String
A reference to the initial category to show. When left blank it will default to the first category in the list.