SDKDOMPluginBase interface

Ashley's avatar
Medal
Construct Team Founder
Published 7 Mar, 2019
118 words
<1 min

The SDKDOMPluginBase interface is used as the base class for a plugin in the runtime that manages a DOM element. Note the constructor also requires passing the DOM_COMPONENT_ID. See the section DOM calls in the C3 runtime for more information.

SDKDOMPluginBase cannot be directly constructed; it should only be used as a base class.

SDKDOMPluginBase derives from SDKPluginBase.

Methods

AddElementMessageHandler(handler, func)

Add a message handler to receive messages posted by PostToRuntimeElement() in DOMElementHandler. handler must match the string passed to PostToRuntimeElement(). func accepts two arguments: the SDK instance, and an optional object with extra details passed to PostToRuntimeElement(). Typically this function simply forwards the handler to an instance method, e.g. this.AddElementMessageHandler("click", (sdkInst, e) => sdkInst._OnClick(e));