Object: sapphire.events |
Description
Adds custom events and listeners.
File
WEB-CORE\scripts\sapphirecore.js
Properties
Property | Type | Description |
oaLoadListeners | Function Array | List of functions to call when the LabVantage page loads. |
registerLoadListener |
Functionality
Registers a function to call when the LabVantage page loads.
Parameters
Parameter | Type | Description |
vFunction | Function | Function to call. |
lInsertBefore | Boolean | Insert at start of event list if true, else insert at end of event list. |
iTimeout | Integer | If specified, will place timeout in milliseconds on calling event. |
Returns
None.
registerListener |
Functionality
Registers a function to call for a specified event.
Parameters
Parameter | Type | Description |
vFunction | Function | Function to call. |
oaArray | Object Array | List of listeners. |
lInsertBefore | Boolean | Insert at start of event list if true, else insert at end of event list. |
iTimeout | Integer | If specified, will place timeout in milliseconds on calling event. |
Returns
None.
callListeners |
Functionality
Calls the events registered in the array.
Parameters
Parameter | Type | Description |
oaArray | Object Array | Array of listeners registered with registerListener. |
Returns
None.
callLoadListeners |
Functionality
Calls the events registered to the LabVantage page load.
Parameters
None.
Returns
None.
attachEvent |
Functionality
Attaches an event to an element. This is a browser-independent function.
Parameters
Parameter | Type | Description |
oElement | Object | Element to which the event is attached. |
sTriggerName | String | Name of the event. You can use either IE syntax (such as onload and onclick) or Mozilla syntax (such as load and click). |
vFunction | String/Object | Pass the script code or function pointer to execute. |
Returns
None.
detachEvent |
Functionality
Detaches an event on an element that has been attached with attachEvent. This is a browser-independent function.
Parameters
Parameter | Type | Description |
oElement | Object | Element from which the event is detached. |
sTriggerName | String | Name of the event. You can use either IE syntax (such as onload and onclick) or Mozilla syntax (such as load and click). |
vFunction | String/Object | Pass the script code or function pointer to detach. |
Returns
None.
fireEvent |
Functionality
Fires an event on an element. This is a browser-independent function. For Mozilla and web kit browsers this uses a basic event inheriting form the generic Event.
Parameters
Parameter | Type | Description |
oElement | Object | Element on which the event is fired. |
sTriggerName | String | Name of the event. You can use either IE syntax (such as onload and onclick) or Mozilla syntax (such as load and click). |
Returns
None.
cancelEvent |
Functionality
Cancels the event to prevent it from bubbling up. This is useful in events that must be trapped (such as onKeyDown or onKeyPress). Passes the event object and Boolean. If Boolean is true then will also stop bubbling of event.
Parameters
Parameter | Type | Description |
eEvent | Object | The event object to cancel. |
lStopBubble | Boolean | Set to true to stop the bubbling of the event. |
Returns
None.
Object: sapphire.events.util |
Description
Utility methods for events.
File
WEB-CORE\scripts\sapphirecore.js
Properties
None.
getButton |
Functionality
Gets the button integer const from the event call. Required because event.which and event.button return different numbers across browsers.
Parameters
Parameter | Type | Description |
e | Object | Event object. |
Returns
Integer.