-
▼$A.reg
-
"$A.reg" provides direct access to all registered AccDC Objects using their unique "id".
-
Syntax
// Access the AccDC Object with the id "myObj"
var dc = $A.reg.myObj;
// Or
var dc = $A.reg['myObj'];
// Allowing you to invoke/modify/query methods/properties/data like so
dc.open();
// Or
$A.reg.myObj.open();
// Or
dc.role = 'Menu';
// Or using AccDC API method chaining
$A.reg.myObj
.open()
.applyFix(9)
.setDrag()
.parent
.css('background', 'url(img/planets/stars.jpg) no-repeat');
Important
-
View the "id" property in the Core API section for additional details regarding the declaration of a unique ID.
-
▼$A.find()
-
"$A.find()" loops through all registered AccDC Objects and executes a callback on each.
-
Parameters:
-
A String value containing one or more AccDC Object "id" values to match, or "*" to select all registered AccDC Objects.
(When entering multiple IDs, separate each with a comma)
-
The callback function that will be applied to all matching AccDC Objects.
(Both "this" and the first argument passed to the callback will be the matched AccDC Object instance.)
Syntax
// Execute a callback on a series of AccDC Objects
$A.find('myObj1,myObj2', function(dc){
alert(dc.role);
// Or
alert(this.role);
});
-
▼.accDCObj
-
The ".accDCObj" property is the DOM node for the AccDC Object framework.
-
Since ".accDCObj" includes the Automatic Accessibility Framework, content should never be added using the ".accDCObj" property;
An error will be generated if the Automatic Accessibility Framework is overwritten;
Use the "source", ".containerDiv", or ".content" properties to add content to an AccDC Object instead.
Syntax
// Access the accDCObj DOM node
$A([
{
runAfter: function(dc){
alert(dc.accDCObj.offsetHeight);
},
...
}
]);
// Or
alert($A.reg.myObj.accDCObj.offsetWidth);
Important
-
Use the AccDC Object ".css()" method to add/modify/retrieve inline style properties for ".accDCObj", which preserves method chaining.
-
As an alternative, the ".accDCObjId" property can be used to access the dynamically generated ID attribute for ".accDCObj". E.G.
var id = dc.accDCObjId;
// Or
var id = $A.reg.myObj.accDCObjId;
-
▼.containerDiv
-
The ".containerDiv" property is the DOM node where visually rendered content for an AccDC Object is stored.
-
All internal DOM node read/write modifications should be confined to the ".containerDiv" property to preserve the Automatic Accessibility Framework.
Syntax
$A([
{
runAfter: function(dc){
dc.containerDiv.appendChild(documentFragment);
},
...
}
]);
// Or
$A.reg.myObj.containerDiv.innerHTML = 'Error: Form field required.';
Important
-
The ".containerDivId" property can be used to access the dynamically generated ID attribute of ".containerDiv". E.G.
var id = dc.containerDivId;
// Or
var id = $A.reg.myObj.containerDivId;
-
▼.triggerObj
-
The "triggerObj" property is the DOM node for the triggering element after an AccDC Object is opened.
-
If the "trigger" property is not included during the setup process to automatically specify a particular triggering element, the "triggerObj" property must be manually set at runtime to allow for strategic DOM insertion.
The "triggerObj" property can optionally be changed to any other focusable DOM node after an AccDC Object is open to ensure that focus control moves appropriately when the AccDC Object is closed.
Syntax
$A([
{
runBefore: function(dc){
dc.triggerObj = document.getElementById('submitBtn');
},
...
}
]);
// Or
$A.reg.myObj.triggerObj = document.getElementById('submitBtn');
// Or to get the triggering element
$A([
{
runAfter: function(dc){
var triggeringElement = dc.triggerObj;
},
...
}
]);
// Or
var triggeringElement = $A.reg.myObj.triggerObj;
Important
-
The "triggerObj" property is not required to be set when the "isStatic" property is used to specify a static insertion point;
-
By default, when an AccDC Object is rendered using the "triggerObj" property as an insertion point, no inline styling is applied.
Use the "cssObj" property to assign persistent inline styles, or the "className" property to assign a persistent class.
-
The "autoPosition" and "autoFix" properties can be used to automatically calculate absolute, relative, and fixed positioning coordinates at runtime.
-
Changing the "triggerObj" property will not add the necessary event bindings to activate the AccDC Object at runtime;
"setTrigger()" must be used for this purpose.
-
Modifying the "triggerObj" property will directly affect the behavior of the "returnFocus" property;
-
Use the "targetObj" property to set a strategic insertion point that will not affect the behavior of the "returnFocus" property.
-
▼.targetObj
-
The ".targetObj" property is a DOM node that sets a strategic insertion point that will not affect the "triggerObj" or "returnFocus" properties.
-
If not set, the "triggerObj" property will automatically be used as the strategic insertion point for an AccDC Object.
Syntax
$A([
{
runBefore: function(dc){
dc.targetObj = dc.triggerObj.parentNode;
},
...
}
]);
// Or
$A.reg.myObj.targetObj = document.getElementById('table1');
Important
-
The "targetObj" property is ignored when the "isStatic" property is used to specify a static insertion point;
-
By default, when an AccDC Object is rendered using the "targetObj" property as an insertion point, no inline styling is applied.
Use the "cssObj" property to assign persistent inline styles, or the "className" property to assign a persistent class.
-
The "autoPosition" and "autoFix" properties can be used to automatically calculate absolute, relative, and fixed positioning coordinates at runtime.
-
Changing the "targetObj" property will not add the necessary event bindings to activate the AccDC Object at runtime;
"setTrigger()" must be used for this purpose.
-
Modifying the "targetObj" property will not affect the behavior of the "returnFocus" property;
-
Use the "triggerObj" property to set a strategic insertion point that will also affect the behavior of the "returnFocus" property.
-
NOTE: If the "targetObj" property is used to designate an insertion point that is too far removed from the triggering element within the DOM, it will present an accessibility issue for screen reader and keyboard only users.
Required: One or the other must be True:
-
The "triggerObj" property must be set to a focusable DOM node.
-
The "returnFocus" property must be set to False.
-
▼.setTrigger()
-
The "setTrigger()" method manually adds all triggering event bindings for an AccDC Object.
-
All prior event bindings for the AccDC Object will be removed when "setTrigger()" is invoked.
Syntax
$A([
{
runAfter: function(dc){
dc.setTrigger();
},
...
}
]);
// Or
$A.reg.myObj.setTrigger();
Important
-
Both of the properties "trigger" and "bind" must be set before "setTrigger()" is invoked.
-
▼.unsetTrigger()
-
The "unsetTrigger()" method manually removes all triggering event bindings for an AccDC Object.
-
Syntax
$A([
{
runAfter: function(dc){
dc.unsetTrigger();
},
...
}
]);
// Or
$A.reg.myObj.unsetTrigger();
-
▼.parent
-
The "parent" property is the object instance of the parent AccDC Object.
-
Syntax
$A([
{
runAfter: function(dc){
alert(dc.parent.role); // The role for the parent AccDC Object
},
...
}
]);
// Or
$A.reg.myObj.parent.close(); // Invokes the close method for the parent AccDC Object
-
▼.children
-
The "children" property is an array of all child AccDC Object instances.
-
Syntax
$A([
{
runAfter: function(dc){
alert(dc.children[0].role); // The role for the first child AccDC Object
},
...
}
]);
// Or
$A.reg.myObj.children[0].open(); // Invokes the open method for the first child AccDC Object
-
▼.siblings
-
The "siblings" property is an array of all AccDC Objects that were registered in the same array.
-
Syntax
$A([
{
runAfter: function(dc){
// Open the third AccDC Object at the same logical level
dc.siblings[2].open();
},
...
}
]);
// Or
$A.reg.myObj.siblings[2].open();
-
▼.top
-
The "top" property is the top level AccDC Object for all child AccDC Objects.
-
Syntax
$A([
{
runAfter: function(dc){
// Close the top level AccDC Object
dc.top.close();
},
...
}
]);
// Or
$A.reg.myObj.top.close();