UNPKG

apex4x

Version:

The Comprehensive ARIA Development Suite

46 lines 4 kB
�� Function: getDC(stringIdOrObject, boolIncludeFromBound) Description: Return the registered DC object bound to a specific string ID or object. Returns: DC Object. Note: ID refers to the matching DC.id property value of a registered DC object. The ID of a DC object must always be unique. Since getDC() is a default function for $A, the syntax $A(stringOrObjectID) will perform the same action as $A.getDC(stringOrObjectID). After a DC object is returned, only valid properties and methods specified in the DC API are available on that object. When boolIncludeFromBound is true, the bound DC object will be returned if present on the specified triggering element. Important: When using the getDC() function to return the bound DC object on a triggering element, it will only return the last DC object bound to that element. View the directions at the end of this file to return a map of multiple DC objects when bound to the same triggering element. Example: // Get the registered DC object with DC.id = "myDCObjectID" var DC = $A.getDC("myDCObjectID"); // Get the registered DC object where DC.id is set to a DOM element. var DC = $A.getDC(domElement); // Get the DC object bound to a triggering element. var DC = $A.getDC(triggeringElement, true); // Or the same using chaining // Get the registered DC object with DC.id = "myDCObjectID" var DC = $A("myDCObjectID"); // Get the registered DC object where DC.id is set to a DOM element as its trigger. var DC = $A(domElement); // Get the DC object bound to a triggering element. var DC = $A(triggeringElement).getDC(true); // When multiple DC objects are bound to the same element, do the following instead. // Get a map of all bound DC objects. var map = $A.data(triggeringElement, "DC-ON"); // Then loop through the map to access each DC object and their properties and methods. $A.loop(map, function(indexNumber, DC) { // Do something with the DC object. alert(DC.id); }, "map");