$JQueryEvent Event


 9.9A

 

The $JQueryEvent can be registered for the HTMLCONTROL object or any Web GUI object. However, the PL/B event 200 ( $JQueryEvent ) is not generated unless one or more jQuery Event(s) is enabled as follows:

 

  1. All Web GUI objects have a new method named 'EnableJqEvent' that can be executed to enable one or more jQuery Event(s) by name. See EnableJqEvent method for more information

  2. For a HTMLCONTROL, an alternative technique enables a specific jQuery Event. In this case, the jQuery Event can be included in the InnerHtml method data string by specifying the HTML attribute formatted as 'data-plbevent={eventnames}' for an HTML objec

  3. The SetAttr method of a HTMLCONTROL object can be used to change the data-plbevent attribute as shown bellow:t.

 

        MyHtmlControl.SetAttr using "myButtonId","data-plbevent","click"

 

When the $JQueryEvent event is generated, the result is always returned as a string JSON object notation which is stored in ARG1.

 

ARG1 contains a JSON object string for the event data that includes the following:

 

 

Name

Value

More information ...

type

The text event name.

https://api.jquery.com/event.type/

id

The 'id' name of the HTML object which generated the event.

 

pageX

The X relative mouse position.

https://api.jquery.com/event.pageX/

pageY

The Y relative mouse position.

https://api.jquery.com/event.pageY/

MetaKey

Flag if meta key state when event occurred.

https://api.jquery.com/event.metaKey/

which

The key value or mouse button caused the event.

https://api.jquery.com/event.which/

target

The currentTarget id value that generated the event.

http://www.w3schools.com/jsref/event_currenttarget.asp

 

 

 Example ARG1 JSON object string returned for jQuery event:

 

{"type":"click","id":"sizzle","pageX":390,"pageY":96,"metaKey":false,"which":1,"target":"sizzle"}

 

 

See Also: EVENTREGISTER, Object Events, Object Instructions, Object Definitions

 



PL/B Language Reference Activate Event