EnableJqEvent Method
9.9A
The EnableJqEvent method enables one or more jQuery events by name for the PWS GUI object. This method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
Flags Affected: OVER, ZERO
Note the following:
The ZERO flag is always set to TRUE because the {return} value is always zero.
The OVER flag is set if the {return} variable is too small to receive the numeric result.
This is an advanced method that is required only when custom coding is performed using the JQuery framework.
The EVENTREGISTER instruction must be executed to register the $JQueryEvent (event number 200) for the object. See EVENTREGISTER for more details.
The EnableJqEvent method uses the {jqevents} and {selector} parameters to invoke the jQuery '.on' method as described at this URL link:
The {jqevents} is a character string that contains one or more jQuery events separated by whitespace characters. The jQuery events as described at this URL link:
The {selector} character string is a filter that determines which HTML element(s} have the jQuery event(s) enabled. If the {selector} parameter is not specified, the 'id' of the {object} specifies the selector. If the {selector} is specified, the {jqevents} are enabled for all HTML objects matching the selector. The {selector} string is passed exactly as specified to the jQuery '.on' method when the EnableJqEvent method is executed.
Note that the jQuery events generated for any of the HTML objects matching the {selector} are sent to the $JQueryEvent (200 event number} registered for the {object} executing this method.
See this following URL link for more information for the {selector} criteria:
http://api.jquery.com/category/selectors/
The {flags} parameter is reserved for future use to control the behaviors of this method.
Example Code:
...
Example Description:
In this case, the {selector} defaults to use the HTML 'id' of Panel1. Therefore, if the user clicks on Panel1, an event to dispatched if the 200 ($JQueryEvent) event has been registered for Panel1.
In this case, the {selector} is specified as '#zz1' as the 'id' of one or more HTML object(s) on Panel1. Therefore, if the user clicks on a HTML object that matches the '#zz1' id, an event is dispatched when the 200 ($JQueryEvent) event has been registered for Panel1.
This EVENTREG instruction registers the $JQueryEvent (event number 200) to dispatch to the 'JqEvPanel' PLB routine where the event results of ARG1 are stored into the 'JsonData' DIM variable.
See Also: Method Syntax
![]() |