Event Helper Class
The Event Helper Class uses the Event Helper Object to facilitate Event Binding in the Physical Renderer or Plug-in Wrapper.
To retrieve the event helper:
var evtHelper = this.Helper("EventHelper" );
Manage is the singular API exposed by the Event Helper Class for unified event binding for DOM elements across multiple platforms. Use the following API specification as a guideline to use the EventHelper object to bind an event:
evtHelper.Manage( el, eventName, eventData, eventHandler );
eventName
to
element el
with event data eventData
and event handler eventHandler
. Use the following API specification as a guideline to use delegate-on type for event binding:
evtHelper.Manage( el, eventName, eventData, eventHandler, elChild );
For example:
var evtHelper = this.Helper( "EventHelper" );
evtHelper.Manage( el, "down" , functionRef );
The down
event is attached to element el
, with functionRef
defined as the Event
Handler. Both touch and mouse events are handled, depending on the
environment. The down
value will get translated to mousedown
in a mouse-enabled environment, and to touchstart
in a touch-enabled environment.