| Package: | CQ.Ext |
| Class: | Element |
| Subclasses: | Layer |
| Extends: | Object |
| Clientlib: | cq.widgets |
| Method | Defined By | |
|---|---|---|
child( String selector, [Boolean returnDom] ) : HTMLElement/CQ.Ext.Element Selects a single child at any depth below this element based on the passed CSS selector (the selector should not cont...
Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id).
Parameters:
|
Element | |
down( String selector, [Boolean returnDom] ) : HTMLElement/CQ.Ext.Element Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).
Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).
Parameters:
|
Element | |
findParent( String selector, [Number/Mixed maxDepth], [Boolean returnEl] ) : HTMLElement Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:fi...
Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
Parameters:
|
Element | |
findParentNode( String selector, [Number/Mixed maxDepth], [Boolean returnEl] ) : HTMLElement Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
Parameters:
|
Element | |
first( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the first child, skipping text nodes
Gets the first child, skipping text nodes
Parameters:
|
Element | |
fly( String/HTMLElement el, [String named] ) : Element Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to t...
Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element - the dom node can be overwritten by other code. Shorthand of CQ.Ext.Element.fly Use this to make one-time references to DOM elements which are not going to be accessed again either by application code, or by Ext's classes. If accessing an element which will be processed regularly, then CQ.Ext.get will be more appropriate to take advantage of the caching provided by the CQ.Ext.Element class.
Parameters:
|
Element | |
get( Mixed el ) : Element <static>
Retrieves CQ.Ext.Element objects.
This method does not retrieve Components. This method
retrieves CQ....
<static>
Retrieves CQ.Ext.Element objects.
This method does not retrieve Components. This method retrieves CQ.Ext.Element objects which encapsulate DOM elements. To retrieve a Component by its ID, use CQ.Ext.ComponentMgr.get. Uses simple caching to consistently return the same object. Automatically fixes if an object was recreated with the same id via AJAX or DOM.
Parameters:
|
Element | |
getTextWidth( String text, [Number min], [Number max] ) : Number Returns the width in pixels of the passed text, or the width of the text in this Element.
Returns the width in pixels of the passed text, or the width of the text in this Element.
Parameters:
|
Element | |
last( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the last child, skipping text nodes
Gets the last child, skipping text nodes
Parameters:
|
Element | |
next( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the next sibling, skipping text nodes
Gets the next sibling, skipping text nodes
Parameters:
|
Element | |
on( String eventName, Function fn, [Object scope], [Object options] ) : void Appends an event handler (shorthand for addListener).
Appends an event handler (shorthand for addListener).
Parameters:
|
Element | |
parent( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the parent node for this element, optionally chaining up trying to match a selector
Gets the parent node for this element, optionally chaining up trying to match a selector
Parameters:
|
Element | |
prev( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the previous sibling, skipping text nodes
Gets the previous sibling, skipping text nodes
Parameters:
|
Element | |
query( String selector ) : Array Selects child nodes based on the passed CSS selector (the selector should not contain an id).
Selects child nodes based on the passed CSS selector (the selector should not contain an id).
Parameters:
|
Element | |
select( String/Array selector, [HTMLElement/String root] ) : CompositeElementLite/CompositeElement Selects elements based on the passed CSS selector to enable Element methods
to be applied to many related elements in...
Selects elements based on the passed CSS selector to enable Element methods
to be applied to many related elements in one statement through the returned CompositeElement or
CompositeElementLite object.
Parameters:
|
Element | |
un( String eventName, Function fn, Object scope ) : CQ.Ext.Element Removes an event handler from this element (see removeListener for additional notes).
Removes an event handler from this element (see removeListener for additional notes).
Parameters:
|
Element | |
up( String selector, [Number/Mixed maxDepth] ) : CQ.Ext.Element Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first...
Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).
This is a shortcut for findParentNode() that always returns an CQ.Ext.Element.
Parameters:
|
Element | |