UNPKG

apex4x

Version:

The Comprehensive ARIA Development Suite

34 lines 3.21 kB
�� Function: toDC(domElementOrStringMarkup, objectKeyValueMap) Description: Converts any HTML source code string or DOM element construct into a registered DC object. Returns: DC Object. Note: If the object being converted is an element already rendered in the DOM, all requisit properties will automatically be set to load the DC object at the same location in the DOM, which will remain true even after the DC object is closed using DC.remove() or DC.render() to rerender the component. If creating a new element using a markup string or a new object instance, then at minimum, the DC API properties "root" or "triggerNode" must be set to render the DC object at the same time. Otherwise, the new DC object will have to be explicitly rendered afterwards using one of the relevant DC API methods for this purpose. The toDC() function always returns a DC object, even when chained. Example: // Create a new, empty DC object that has no custom content to start with. var DC = $A.toDC(); // Create a new DC object with customization that is not specifically associated with a DOM element. var DC = $A.toDC({ // Optional DC API properties and methods here. }); // Convert a DOM element into a DC object. var DC = $A.toDC(domElement, { // Optional DC API properties and methods here. }); // Fetch an external control and convert it into a DC object to render with behavior declarations. var DC = $A.toDC("path/resource.php?params#ExternalElementId", { root: 'body', append: true, forceFocus: true, afterRender: function(DC) { // Do something. } });