X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..92c2b89db26be16707f4a805d3303ab2531006e1:/docs/output/Ext.CompositeElement.html diff --git a/docs/output/Ext.CompositeElement.html b/docs/output/Ext.CompositeElement.html index ce0efad4..c52ea01e 100644 --- a/docs/output/Ext.CompositeElement.html +++ b/docs/output/Ext.CompositeElement.html @@ -1,38 +1,84 @@ -
CompositeElementLite CompositeElement
Package: | Ext |
Defined In: | CompositeElement.js |
Class: | CompositeElement |
Extends: | CompositeElementLite |
var els = Ext.select("#some-el div.some-class", true);
- // or select directly from an existing element
- var el = Ext.get('some-el');
- el.select('div.some-class', true);
+CompositeElementLite
CompositeElement
Class Ext.CompositeElement
Package: Ext Defined In: CompositeElement.js Class: CompositeElement Extends: CompositeElementLite
This class encapsulates a collection of DOM elements, providing methods to filter
+members, or to perform collective actions upon the whole set.
+Although they are not listed, this class supports all of the methods of Ext.Element and
+Ext.Fx. The methods from these classes will be performed on all the elements in this collection.
+All methods return this and can be chained.
+Usage:
+var els = Ext.select("#some-el div.some-class", true);
+// or select directly from an existing element
+var el = Ext.get('some-el');
+el.select('div.some-class', true);
- els.setWidth(100); // all elements become 100 width
- els.hide(true); // all elements fade out and hide
- // or
- els.setWidth(100).hide(true);
Public Properties
This class has no public properties.Public Methods
Method Defined By add( String/Array els
)
+els.setWidth(100); // all elements become 100 width
+els.hide(true); // all elements fade out and hide
+// or
+els.setWidth(100).hide(true);Public Properties
Property Defined By elements : ArrayThe Array of DOM elements which this CompositeElement encapsulates. Read-only.
+This will not usually be accessed in ...The Array of DOM elements which this CompositeElement encapsulates. Read-only.
+This will not usually be accessed in developers' code, but developers wishing
+to augment the capabilities of the CompositeElementLite class may use it when adding
+methods to the class.
+For example to add the nextAll
method to the class to add all
+following siblings of selected elements, the code would be
+Ext.override(Ext.CompositeElementLite, {
+ nextAll: function() {
+ var els = this.elements, i, l = els.length, n, r = [], ri = -1;
+
+// Loop through all elements in this Composite, accumulating
+// an Array of all siblings.
+ for (i = 0; i < l; i++) {
+ for (n = els[i].nextSibling; n; n = n.nextSibling) {
+ r[++ri] = n;
+ }
+ }
+
+// Add all found siblings to this Composite
+ return this.add(r);
+ }
+});
CompositeElementLite
Public Methods
Method Defined By ( Function fn
, [Object scope
] )
+ :
+ CompositeElementIterates each element in this composite
+calling the supplied function using Ext.each.Iterates each element
in this composite
+calling the supplied function using Ext.each.Parameters:fn
: FunctionThe function to be called with each
+element
. If the supplied function returns false,
+iteration stops. This function is called with the following arguments:
+
+element
: Ext.ElementThe element at the current index
+in the composite
+composite
: Object This composite.
+index
: Number The current index within the composite
+
scope
: Object(optional) The scope ( reference) in which the specified function is executed.
+Defaults to the element
at the current index
+within the composite.
Returns:CompositeElement
this
CompositeElement add( Mixed els
)
:
- CompositeElementAdds elements to this composite.Adds elements to this composite.Parameters:els
: String/ArrayA string CSS selector, an array of elements or an element
Returns:CompositeElement
this
CompositeElement clear()
+ CompositeElementAdds elements to this Composite object.Adds elements to this Composite object.Parameters:els
: MixedEither an Array of DOM elements to add, or another Composite object who's elements should be added.
Returns:CompositeElement
This Composite object.
CompositeElementLite clear()
:
voidRemoves all elements.Removes all elements.Parameters:- None.
Returns:- void
CompositeElementLite contains( el {Mixed}
)
:
- BooleanReturns true if this composite contains the passed elementReturns true if this composite contains the passed elementParameters:{Mixed}
: elThe id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
Returns:Boolean
CompositeElementLite each( Function fn
, [Object scope
] )
+ BooleanReturns true if this composite contains the passed elementReturns true if this composite contains the passed elementParameters:{Mixed}
: elThe id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
Returns:Boolean
CompositeElementLite each( Function fn
, [Object scope
] )
:
- CompositeElementCalls the passed function passing (el, this, index) for each element in this composite.Calls the passed function passing (el, this, index) for each element in this composite.Parameters:fn
: FunctionThe function to callscope
: Object(optional) The this object (defaults to the element)
Returns:CompositeElement
this
CompositeElement fill( String/Array els
)
+ CompositeElementCalls the passed function for each element in this composite.Calls the passed function for each element in this composite.
Parameters:fn
: FunctionThe function to call. The function is passed the following parameters:
+- el : ElementThe current Element in the iteration.
+This is the flyweight (shared) Ext.Element instance, so if you require a
+a reference to the dom node, use el.dom.
+- c : CompositeThis Composite object.
+- idx : NumberThe zero-based index in the iteration.
+
scope
: Object(optional) The scope (this reference) in which the function is executed. (defaults to the Element)
Returns:CompositeElement
this
CompositeElementLite fill( Mixed els
)
:
- CompositeElementClears this composite and adds the elements returned by the passed selector.Clears this composite and adds the elements returned by the passed selector.Parameters:els
: String/ArrayA string CSS selector, an array of elements or an element
Returns:CompositeElement
this
CompositeElementLite filter( String selector
)
+ CompositeElementClears this Composite and adds the elements passed.Clears this Composite and adds the elements passed.Parameters:els
: MixedEither an array of DOM elements, or another Composite from which to fill this Composite.
Returns:CompositeElement
this
CompositeElementLite filter( String/Function selector
)
:
- CompositeElementFilters this composite to only elements that match the passed selector.Filters this composite to only elements that match the passed selector.Parameters:selector
: StringA string CSS selector
Returns:CompositeElement
this
CompositeElementLite first()
+ CompositeElementFilters this composite to only elements that match the passed selector.Filters this composite to only elements that match the passed selector.Parameters:selector
: String/FunctionA string CSS selector or a comparison function.
+The comparison function will be called with the following arguments:
+el
: Ext.ElementThe current DOM element.
+index
: NumberThe current index within the collection.
+
Returns:CompositeElement
this
CompositeElementLite first()
:
Ext.ElementReturns the first ElementReturns the first ElementParameters:- None.
Returns:Ext.Element
CompositeElementLite getCount()
:
- NumberReturns the number of elements in this compositeReturns the number of elements in this compositeParameters:- None.
Returns:Number
CompositeElementLite indexOf( el {Mixed}
)
+ NumberReturns the number of elements in this Composite.Returns the number of elements in this Composite.Parameters:- None.
Returns:Number
CompositeElementLite indexOf( el {Mixed}
)
:
- NumberFind the index of the passed element within the composite collection.Find the index of the passed element within the composite collection.Parameters:{Mixed}
: elThe id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
Returns:Number
The index of the passed Ext.Element in the composite collection, or -1 if not found.
CompositeElementLite item( Number index
)
+ NumberFind the index of the passed element within the composite collection.Find the index of the passed element within the composite collection.Parameters:{Mixed}
: elThe id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
Returns:Number
The index of the passed Ext.Element in the composite collection, or -1 if not found.
CompositeElementLite item( Number index
)
:
- Ext.ElementReturns the Element object at the specified indexReturns the Element object at the specified indexParameters:index
: Number
Returns:Ext.Element
CompositeElement last()
+ Ext.ElementReturns a flyweight Element of the dom element object at the specified indexReturns a flyweight Element of the dom element object at the specified indexParameters:index
: Number
Returns:Ext.Element
CompositeElementLite last()
:
Ext.ElementReturns the last ElementReturns the last ElementParameters:- None.
Returns:Ext.Element
CompositeElementLite removeElement( Mixed el
, [Boolean removeDom
] )
: