ElementQuery class

A query object of a collection of Element.

Inheritance

Constructors

ElementQuery(List<Element> elements)
factory

Properties

context → dynamic
The DOM node context originally passed to Query; if none was passed [...]
read-only, inherited
data Data
The interface to access custom element data.
read-only, inherited
first Element
Returns the first element. [...]
read / write, inherited
firstIfAny Element
Return the first matched element, or null if empty.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
height int
Retrieve the height of the first element of this collection.
read-only, inherited
html String
Get the inner HTML contents of the first element.
read / write
isEmpty bool
Returns true if there are no elements in this collection. [...]
read-only, inherited
isNotEmpty bool
Returns true if there is at least one element in this collection. [...]
read-only, inherited
iterator Iterator<Element>
Returns a new Iterator that allows iterating the elements of this Iterable. [...]
read-only, inherited
last Element
Returns the last element. [...]
read / write, inherited
length int
The number of objects in this list. [...]
read / write, inherited
offset Point<num>
Get the current coordinates of the first element, relative to the document.
read / write
offsetLeft int
Set the x coordinate of every element in this collection, relative to the [...]
write-only
offsetParent ElementQuery
Get the closest ancestor element that is positioned.
read-only
offsetTop int
Set the y coordinate of every element in this collection, relative to the [...]
write-only
position Point<num>
Get the current coordinates of the first element in the set of matched [...]
read-only
reversed Iterable<Element>
Returns an Iterable of the objects in this list in reverse order.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scrollLeft int
Get the current horizontal position of the scroll bar for the first element [...]
read / write, inherited
scrollTop int
Get the current vertical position of the scroll bar for the first element [...]
read / write, inherited
selector String
read-only, inherited
single Element
Checks that this iterable has only one element, and returns that element. [...]
read-only, inherited
text String
Get the combined text contents over all elements in this collection.
read / write
width int
Retrieve the width of the first element of this collection.
read-only, inherited

Methods

add(Element value) → void
Adds value to the end of this list, extending the length by one. [...]
inherited
addAll(Iterable<Element> iterable) → void
Appends all objects of iterable to the end of this list. [...]
inherited
addClass(String name) → void
Add the CSS class of given name to all the elements in this collection.
after(dynamic content) → void
Insert content after each element in this collection. [...]
any(bool test(Element element)) bool
Checks whether any element of this iterable satisfies test. [...]
inherited
append(dynamic content) → void
Insert content to the end of each element in this collection. [...]
appendTo(dynamic target) → void
Insert every element in this collection to the end of the target. [...]
asMap() Map<int, Element>
Returns an unmodifiable Map view of this. [...]
inherited
before(dynamic content) → void
Insert content before each element in this collection. [...]
cast<R>() List<R>
Returns a view of this list as a list of R instances. [...]
inherited
change([QueryEventListener handler]) → void
Bind an event handler to the "change" event, or trigger that event [...]
children([String selector]) ElementQuery
Retrieve the union of childrens of each element in this collection. [...]
clear() → void
Removes all objects from this list; the length of the list becomes zero. [...]
inherited
click([QueryEventListener handler]) → void
Bind an event handler to the "click" event, or trigger that event [...]
clone([bool withDataAndEvents, bool deepWithDataAndEvents]) ElementQuery
Create a deep copy of the elements in this collection. [...]
closest(String selector) ElementQuery
Retrieve the closest ancestor (including itself) of each element in this [...]
contains(Object element) bool
Returns true if the collection contains an element equal to element. [...]
inherited
css(String name, [String value]) → dynamic
Get the style property value of the given name on the first element [...]
detach({String selector, bool data: true}) → void
Remove the elements from the DOM. [...]
elementAt(int index) Element
Returns the indexth element. [...]
inherited
empty() → void
Remove all child nodes of the elements in this collection from the DOM.
end() Query
Pops out the top Query object in the stack and retrieve the previous one. [...]
inherited
every(bool test(Element element)) bool
Checks whether every element of this iterable satisfies test. [...]
inherited
expand<T>(Iterable<T> f(Element element)) Iterable<T>
Expands each element of this Iterable into zero or more elements. [...]
inherited
fillRange(int start, int end, [Element fillValue]) → void
Sets the objects in the range start inclusive to end exclusive to the given fillValue. [...]
inherited
find(String selector) ElementQuery
Retrieve an ElementQuery containing descendants of this element collection [...]
inherited
firstWhere(bool test(Element element), {Element orElse()}) Element
Returns the first element that satisfies the given predicate test. [...]
inherited
fold<T>(T initialValue, T combine(T previousValue, Element element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value [...]
inherited
followedBy(Iterable<Element> other) Iterable<Element>
Returns the lazy concatenation of this iterable and other. [...]
inherited
forEach(void f(Element element)) → void
Applies the function f to each element of this collection in iteration order.
inherited
getRange(int start, int end) Iterable<Element>
Returns an Iterable that iterates over the objects in the range start inclusive to end exclusive. [...]
inherited
hasClass(String name) bool
Return true if any of the element contains the given name in its CSS [...]
hide() → void
Hide all the elements in this collection by setting their CSS disaply [...]
indexOf(Element element, [int start = 0]) int
Returns the first index of element in this list. [...]
inherited
indexWhere(bool test(Element element), [int start = 0]) int
Returns the first index in the list that satisfies the provided test. [...]
inherited
insert(int index, Element element) → void
Inserts the object at position index in this list. [...]
inherited
insertAll(int index, Iterable<Element> iterable) → void
Inserts all objects of iterable at position index in this list. [...]
inherited
join([String separator = ""]) String
Converts each element to a String and concatenates the strings. [...]
inherited
lastIndexOf(Element element, [int start]) int
Returns the last index of element in this list. [...]
inherited
lastIndexWhere(bool test(Element element), [int start]) int
Returns the last index in the list that satisfies the provided test. [...]
inherited
lastWhere(bool test(Element element), {Element orElse()}) Element
Returns the last element that satisfies the given predicate test. [...]
inherited
map<T>(T f(Element e)) Iterable<T>
Returns a new lazy Iterable with elements that are created by calling f on each element of this Iterable in iteration order. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
off(String types, {String selector, QueryEventListener handler}) → void
Unregister a handler for events of given types. [...]
inherited
on(String types, QueryEventListener handler, {String selector}) → void
Register a handler for events of given types on selected elements. [...]
inherited
one(String types, QueryEventListener handler, {String selector}) → void
Register a one-time handler for events of given types. Once called, [...]
inherited
parent([String selector]) ElementQuery
Retrieve the parents of each element in this collection. [...]
prepend(dynamic content) → void
Insert content to the beginning of each element in this collection. [...]
prependTo(dynamic target) → void
Insert every element in this collection to the beginning of the target. [...]
pushStack(List<Element> elems) ElementQuery
Add a collection of DOM elements onto the Query stack.
inherited
reduce(Element combine(Element value, Element element)) Element
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function. [...]
inherited
reflow() → void
Force the browser to reflow the given element to apply the latest [...]
remove(Object value) bool
Removes the first occurrence of value from this list. [...]
inherited
removeAt(int index) Element
Removes the object at position index from this list. [...]
inherited
removeClass(String name) → void
Remove the CSS class of given name from all the elements in this collection.
removeLast() Element
Pops and returns the last object in this list. [...]
inherited
removeRange(int start, int end) → void
Removes the objects in the range start inclusive to end exclusive. [...]
inherited
removeWhere(bool test(Element element)) → void
Removes all objects from this list that satisfy test. [...]
inherited
replaceRange(int start, int end, Iterable<Element> replacement) → void
Removes the objects in the range start inclusive to end exclusive and inserts the contents of replacement in its place. [...]
inherited
retainWhere(bool test(Element element)) → void
Removes all objects from this list that fail to satisfy test. [...]
inherited
setAll(int index, Iterable<Element> iterable) → void
Overwrites objects of this with the objects of iterable, starting at position index in this list. [...]
inherited
setRange(int start, int end, Iterable<Element> iterable, [int skipCount = 0]) → void
Copies the objects of iterable, skipping skipCount objects first, into the range start, inclusive, to end, exclusive, of the list. [...]
inherited
show() → void
Show all the elements in this collection by changing their CSS display [...]
shuffle([Random random]) → void
Shuffles the elements of this list randomly.
inherited
singleWhere(bool test(Element element), {Element orElse()}) Element
Returns the single element that satisfies test. [...]
inherited
skip(int count) Iterable<Element>
Returns an Iterable that provides all but the first count elements. [...]
inherited
skipWhile(bool test(Element value)) Iterable<Element>
Returns an Iterable that skips leading elements while test is satisfied. [...]
inherited
sort([int compare(Element a, Element b)]) → void
Sorts this list according to the order specified by the compare function. [...]
inherited
sublist(int start, [int end]) List<Element>
Returns a new list containing the elements between start and end. [...]
inherited
take(int count) Iterable<Element>
Returns a lazy iterable of the count first elements of this iterable. [...]
inherited
takeWhile(bool test(Element value)) Iterable<Element>
Returns a lazy iterable of the leading elements satisfying test. [...]
inherited
toggle([bool state]) → void
Toggle the visibility of all the elements in this collection by altering [...]
toggleClass(String name) → void
Toggle the CSS class of given name in all the elements in this collection.
toList({bool growable: true}) List<Element>
Creates a List containing the elements of this Iterable. [...]
inherited
toSet() Set<Element>
Creates a Set containing the same elements as this iterable. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
trigger(String type, {dynamic data}) → void
Trigger an event of given type on all matched elements, with given [...]
inherited
triggerEvent(QueryEvent event) → void
Trigger the given event on all matched elements, with given data if [...]
inherited
triggerHandler(String type, {dynamic data}) → void
Trigger an event of given type on the first (if any) matched element, [...]
inherited
where(bool test(Element element)) Iterable<Element>
Returns a new lazy Iterable with all elements that satisfy the predicate test. [...]
inherited
whereType<T>() Iterable<T>
Returns a new lazy Iterable with all elements that have type T. [...]
inherited

Operators

operator +(List<Element> other) List<Element>
Returns the concatenation of this list and other. [...]
inherited
operator ==(Object other) bool
The equality operator. [...]
inherited
operator [](int index) Element
Returns the object at the given index in the list or throws a RangeError if index is out of bounds.
inherited
operator []=(int index, Element value) → void
Sets the value at the given index in the list to value or throws a RangeError if index is out of bounds.
inherited