Register to Events      

Description

Registers the toolkit support set to listen for events on the elements contained in the custom control.

Syntax

function <register to events>(elem)

Argument

Type

Description

elem
Variant
Unused. Preserved for backward compatibility.

Return Value

true on success, otherwise false.

Remarks
Example

In this example, the toolkit support set registers for onclick events for each panel header in a StackPanel.

From the toolkit configuration file:

<Control>

    <Record>

        <EventListening use_default_event_handling_for_children="false"

            use_default_event_handling="true"

            type="javascript" function="ConnectToEvents"/>

    </Record>

</Control>

The event handlers will be passed a reference to the stacked panel on which the event occurred.

function ConnectToEvents(elem)

{

    var stackPanels = getStackPanelItems(_elem);

    // Listen to click events on each of the panel headers in the StackPanel.

    for (var i = 0; i < stackPanels.length; i++)

    {

        _util.RegisterForEvent(stackPanels[i], "onclick",

            "OnPanelSelect", stackPanels[i]);

    }

    return true;

}