dojo.NodeList instances provide many utilities that reflect
core Dojo APIs for Array iteration and manipulation, DOM
manipulation, and event handling. Instead of needing to dig up
functions in the dojo.* namespace, NodeLists generally make the
full power of Dojo available for DOM manipulation tasks in a
simple, chainable way.
|
|
|
_anim(
obj
method
args
) :
void
Parameter |
Type |
Usage |
Description |
obj |
|
required |
|
method |
|
required |
|
args |
|
required |
|
|
|
|
|
_buildArrayFromCallback(
callback
: Function
) :
void
builds a new array of possibly differing size based on the input list.
Since the returned array is likely of different size than the input array,
the array's map function cannot be used.
Parameter |
Type |
Usage |
Description |
callback |
Function |
required |
|
|
|
|
|
_cloneNode(
node
: DOMNode
) :
void
private utiltity to clone a node. Not very interesting in the vanilla
dojo.NodeList case, but delegates could do interesting things like
clone event handlers if that is derivable from the node.
Parameter |
Type |
Usage |
Description |
node |
DOMNode |
required |
|
|
|
|
|
_filterQueryResult(
nodeList
query
) :
void
Parameter |
Type |
Usage |
Description |
nodeList |
|
required |
|
query |
|
required |
|
|
|
|
|
_getRelatedUniqueNodes(
query
: String
callback
: Function
) :
void
|
|
|
|
_getUniqueAsNodeList(
nodes
) :
void
given a list of nodes, make sure only unique
elements are returned as our NodeList object.
Does not call _stash().
Parameter |
Type |
Usage |
Description |
nodes |
|
required |
|
|
|
|
|
_getUniqueNodeListWithParent(
nodes
query
) :
void
gets unique element nodes, filters them further
with an optional query and then calls _stash to track parent NodeList.
Parameter |
Type |
Usage |
Description |
nodes |
|
required |
|
query |
|
required |
|
|
|
|
|
_normalize(
content
: String||Element||Object||NodeList
refNode
: DOMNode
) :
void
normalizes data to an array of items to insert.
If content is an object, it can have special properties "template" and
"parse". If "template" is defined, then the template value is run through
dojo.string.substitute (if dojo.string.substitute has been dojo.required elsewhere),
or if templateFunc is a function on the content, that function will be used to
transform the template into a final string to be used for for passing to dojo._toDom.
If content.parse is true, then it is remembered for later, for when the content
nodes are inserted into the DOM. At that point, the nodes will be parsed for widgets
(if dojo.parser has been dojo.required elsewhere).
Parameter |
Type |
Usage |
Description |
content |
String||Element||Object||NodeList |
required |
|
refNode |
DOMNode |
optional |
|
|
|
|
|
_place(
ary
: Array
refNode
: DOMNode
position
: String
useClone
: Boolean
) :
void
private utility to handle placing an array of nodes relative to another node.
Allows for cloning the nodes in the array, and for
optionally parsing widgets, if ary._runParse is true.
Parameter |
Type |
Usage |
Description |
ary |
Array |
required |
|
refNode |
DOMNode |
required |
|
position |
String |
required |
|
useClone |
Boolean |
required |
|
|
|
|
|
_placeMultiple(
query
: String||Node||NodeList
position
: String
) :
void
private method for inserting queried nodes into all nodes in this NodeList
at different positions. Differs from NodeList.place because it will clone
the nodes in this NodeList if the query matches more than one element.
Parameter |
Type |
Usage |
Description |
query |
String||Node||NodeList |
required |
|
position |
String |
required |
|
|
|
|
|
_stash(
parent
) :
void
private function to hold to a parent NodeList. end() to return the parent NodeList.
Parameter |
Type |
Usage |
Description |
parent |
|
required |
|
Examples
|
|
|
|
addClass(
className
: String|Array
) :
void
adds the specified class to every node in the list
Parameter |
Type |
Usage |
Description |
className |
String|Array |
required |
A String class name to add, or several space-separated class names,
or an array of class names. |
|
|
|
|
addContent(
content
: String||DomNode||Object||dojo.NodeList
position
: String||Integer
) :
void
add a node, NodeList or some HTML as a string to every item in the
list. Returns the original list.
a copy of the HTML content is added to each item in the
list, with an optional position argument. If no position
argument is provided, the content is appended to the end of
each item.
Parameter |
Type |
Usage |
Description |
content |
String||DomNode||Object||dojo.NodeList |
required |
DOM node, HTML in string format, a NodeList or an Object. If a DOM node or
NodeList, the content will be cloned if the current NodeList has more than one
element. Only the DOM nodes are cloned, no event handlers. If it is an Object,
it should be an object with at "template" String property that has the HTML string
to insert. If dojo.string has already been dojo.required, then dojo.string.substitute
will be used on the "template" to generate the final HTML string. Other allowed |
position |
String||Integer |
optional |
|
Examples
|
|
|
|
adopt(
queryOrListOrNode
: String||Array||DomNode
position
: String
) :
void
places any/all elements in queryOrListOrNode at a
position relative to the first element in this list.
Returns a dojo.NodeList of the adopted elements.
Parameter |
Type |
Usage |
Description |
queryOrListOrNode |
String||Array||DomNode |
required |
a DOM node or a query string or a query result.
Represents the nodes to be adopted relative to the
first element of this NodeList. |
position |
String |
optional |
|
|
|
|
|
after(
content
: String||Element||NodeList
) :
void
Places the content after every node in the NodeList.
The content will be cloned if the length of NodeList
is greater than 1. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
content |
String||Element||NodeList |
required |
|
Examples
|
|
|
|
andSelf(
) :
void
Adds the nodes from the previous dojo.NodeList to the current dojo.NodeList.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Examples
|
|
|
|
anim(
properties
: Object
duration
: Integer
easing
: Function
onEnd
: Function
delay
: Integer
) :
void
Animate one or more CSS properties for all nodes in this list.
The returned animation object will already be playing when it
is returned. See the docs for dojo.anim for full details.
Parameter |
Type |
Usage |
Description |
properties |
Object |
required |
the properties to animate |
duration |
Integer |
optional |
Optional. The time to run the animations for |
easing |
Function |
optional |
Optional. The easing function to use. |
onEnd |
Function |
optional |
A function to be called when the animation ends |
delay |
Integer |
optional |
how long to delay playing the returned animation |
Examples
|
|
|
|
animateProperty(
args
) :
void
see dojo.animateProperty(). Animate all elements of this
NodeList across the properties specified.
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
Examples
|
|
|
|
append(
content
: String||DOMNode||NodeList
) :
void
appends the content to every node in the NodeList.
The content will be cloned if the length of NodeList
is greater than 1. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
content |
String||DOMNode||NodeList |
required |
|
Examples
|
|
|
|
appendTo(
query
: String
) :
void
appends nodes in this NodeList to the nodes matched by
the query passed to appendTo.
The nodes in this NodeList will be cloned if the query
matches more than one element. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
query |
String |
required |
|
Examples
|
|
|
|
at(
index
: Integer
) :
void
Returns a new NodeList comprised of items in this NodeList
at the given index or indices.
Parameter |
Type |
Usage |
Description |
index |
Integer |
one-or-more |
One or more 0-based indices of items in the current
NodeList. |
|
|
|
|
attr(
property
: String
value
: String
) :
void
gets or sets the DOM attribute for every element in the
NodeList. See also dojo.attr
Parameter |
Type |
Usage |
Description |
property |
String |
required |
the attribute to get/set |
value |
String |
optional |
optional. The value to set the property to |
Examples
|
|
|
|
before(
content
: String||DOMNode||NodeList
) :
void
Places the content before every node in the NodeList.
The content will be cloned if the length of NodeList
is greater than 1. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
content |
String||DOMNode||NodeList |
required |
|
Examples
|
|
|
|
children(
query
: String
) :
void
Returns all immediate child elements for nodes in this dojo.NodeList.
Optionally takes a query to filter the child elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
clone(
) :
void
Clones all the nodes in this NodeList and returns them as a new NodeList.
Only the DOM nodes are cloned, not any attached event handlers.
Examples
|
|
|
|
closest(
query
: String
) :
void
Returns closest parent that matches query, including current node in this
dojo.NodeList if it matches the query.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
required |
a CSS selector. |
Examples
|
|
|
|
concat(
item
: Object
) :
void
Returns a new NodeList comprised of items in this NodeList
as well as items passed in as parameters
This method behaves exactly like the Array.concat method
with the caveat that it returns a `dojo.NodeList` and not a
raw Array. For more details, see the (Array.concat
Parameter |
Type |
Usage |
Description |
item |
Object |
optional |
Any number of optional parameters may be passed in to be
spliced into the NodeList |
|
|
|
|
connect(
methodName
: String
objOrFunc
: Object|Function|String
funcName
: String
) :
void
attach event handlers to every item of the NodeList. Uses dojo.connect()
so event properties are normalized
Parameter |
Type |
Usage |
Description |
methodName |
String |
required |
the name of the method to attach to. For DOM events, this should be
the lower-case name of the event |
objOrFunc |
Object|Function|String |
required |
if 2 arguments are passed (methodName, objOrFunc), objOrFunc should
reference a function or be the name of the function in the global
namespace to attach. If 3 arguments are provided
(methodName, objOrFunc, funcName), objOrFunc must be the scope to
locate the bound function in |
funcName |
String |
optional |
optional. A string naming the function in objOrFunc to bind to the
event. May also be a function reference. |
Examples
|
|
|
|
coords(
) :
void
Returns the box objects of all elements in a node list as
an Array (*not* a NodeList). Acts like dojo.coords , though assumes
the node passed is each node in this list.
|
|
|
|
empty(
) :
void
clears all content from each node in the list. Effectively
equivalent to removing all child nodes from every item in
the list.
|
|
|
|
end(
) :
void
Ends use of the current dojo.NodeList by returning the previous dojo.NodeList
that generated the current dojo.NodeList.
Returns the `dojo.NodeList` that generated the current `dojo.NodeList`. If there
is no parent dojo.NodeList, an empty dojo.NodeList is returned.
Examples
|
|
|
|
even(
) :
void
Returns the even nodes in this dojo.NodeList as a dojo.NodeList.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Examples
|
|
|
|
every(
callback
: Function:
thisObject
: Object:
) :
void
see dojo.every() and the (Array.every
Parameter |
Type |
Usage |
Description |
callback |
Function: |
required |
the callback |
thisObject |
Object: |
optional |
the context |
|
|
|
|
fadeIn(
args
) :
void
fade in all elements of this NodeList. Returns an instance of dojo.Animation
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
Examples
|
|
|
|
fadeOut(
args
) :
void
fade out all elements of this NodeList. Returns an instance of dojo.Animation
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
Examples
|
|
|
|
filter(
simpleFilter
: String|Function
) :
void
"masks" the built-in javascript filter() method (supported
in Dojo via dojo.filter ) to support passing a simple
string filter in addition to supporting filtering function
objects.
Parameter |
Type |
Usage |
Description |
simpleFilter |
String|Function |
required |
If a string, a single-expression CSS rule. For example,
".thinger" or "#someId[attrName='value']" but not "div >
span". In short, anything which does not invoke a descent
to evaluate but can instead be used to test a single node
is acceptable. |
Examples
|
|
|
|
first(
) :
void
Returns the first node in this dojo.NodeList as a dojo.NodeList.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Examples
|
|
|
|
forEach(
callback
thisObj
) :
void
see dojo.forEach() . The primary difference is that the acted-on
array is implicitly this NodeList. If you want the option to break out
of the forEach loop, use every() or some() instead.
Parameter |
Type |
Usage |
Description |
callback |
|
required |
|
thisObj |
|
required |
|
|
|
|
|
html(
content
params
: Object
) :
void
see the information for "innerHTML". "html" is an alias for "innerHTML", but is
only defined if dojo.NodeList-html has not been loaded.
An alias for the "innerHTML" method, but only defined if there is not an existing
"html" method on dojo.NodeList. Be careful if you are working in an environment
where it is possible that dojo.NodeList-html could have been loaded, since its
definition of "html" will take precedence. If you are not sure if dojo.NodeList-html
could be loaded, use the "innerHTML" method.
Parameter |
Type |
Usage |
Description |
content |
|
required |
|
params |
Object |
optional |
|
Examples
|
|
|
|
indexOf(
value
: Object:
fromIndex
: Integer:
) :
void
see dojo.indexOf(). The primary difference is that the acted-on
array is implicitly this NodeList
For more details on the behavior of indexOf, see Mozilla's
(indexOf
Parameter |
Type |
Usage |
Description |
value |
Object: |
required |
The value to search for. |
fromIndex |
Integer: |
optional |
The loction to start searching from. Optional. Defaults to 0. |
|
|
|
|
innerHTML(
value
: String||DOMNode|NodeList
) :
void
allows setting the innerHTML of each node in the NodeList,
if there is a value passed in, otherwise, reads the innerHTML value of the first node.
This method is simpler than the dojo.NodeList.html() method provided by
`dojo.NodeList-html`. This method just does proper innerHTML insertion of HTML fragments,
and it allows for the innerHTML to be read for the first node in the node list.
Since dojo.NodeList-html already took the "html" name, this method is called
"innerHTML". However, if dojo.NodeList-html has not been loaded yet, this
module will define an "html" method that can be used instead. Be careful if you
are working in an environment where it is possible that dojo.NodeList-html could
have been loaded, since its definition of "html" will take precedence.
The nodes represented by the value argument will be cloned if more than one
node is in this NodeList. The nodes in this NodeList are returned in the "set"
usage of this method, not the HTML that was inserted.
Parameter |
Type |
Usage |
Description |
value |
String||DOMNode|NodeList |
optional |
|
Examples
|
|
|
|
insertAfter(
query
: String
) :
void
The nodes in this NodeList will be placed after the nodes
matched by the query passed to insertAfter.
The nodes in this NodeList will be cloned if the query
matches more than one element. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
query |
String |
required |
|
Examples
|
|
|
|
insertBefore(
query
: String
) :
void
The nodes in this NodeList will be placed after the nodes
matched by the query passed to insertAfter.
The nodes in this NodeList will be cloned if the query
matches more than one element. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
query |
String |
required |
|
Examples
|
|
|
|
instantiate(
declaredClass
: String|Object
properties
: Object
) :
void
Create a new instance of a specified class, using the
specified properties and each node in the nodeList as a
srcNodeRef.
Parameter |
Type |
Usage |
Description |
declaredClass |
String|Object |
required |
|
properties |
Object |
optional |
|
Examples
|
|
|
|
last(
) :
void
Returns the last node in this dojo.NodeList as a dojo.NodeList.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Examples
|
|
|
|
lastIndexOf(
value
: Object
fromIndex
: Integer
) :
void
see dojo.lastIndexOf(). The primary difference is that the
acted-on array is implicitly this NodeList
For more details on the behavior of lastIndexOf, see
Mozilla's (lastIndexOf
Parameter |
Type |
Usage |
Description |
value |
Object |
required |
The value to search for. |
fromIndex |
Integer |
optional |
The loction to start searching from. Optional. Defaults to 0. |
|
|
|
|
map(
func
: Function
obj
: Function
) :
void
see dojo.map(). The primary difference is that the acted-on
array is implicitly this NodeList and the return is a
dojo.NodeList (a subclass of Array)
/return d.map(this, func, obj, d.NodeList); // dojo.NodeList
Parameter |
Type |
Usage |
Description |
func |
Function |
required |
|
obj |
Function |
optional |
|
|
|
|
|
next(
query
: String
) :
void
Returns the next element for nodes in this dojo.NodeList.
Optionally takes a query to filter the next elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
nextAll(
query
: String
) :
void
Returns all sibling elements that come after the nodes in this dojo.NodeList.
Optionally takes a query to filter the sibling elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
odd(
) :
void
Returns the odd nodes in this dojo.NodeList as a dojo.NodeList.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Examples
|
|
|
|
orphan(
simpleFilter
: String
) :
void
removes elements in this list that match the simple filter
from their parents and returns them as a new NodeList.
Parameter |
Type |
Usage |
Description |
simpleFilter |
String |
optional |
single-expression CSS rule. For example, ".thinger" or
"#someId[attrName='value']" but not "div > span". In short,
anything which does not invoke a descent to evaluate but
can instead be used to test a single node is acceptable. |
|
|
|
|
parent(
query
: String
) :
void
Returns immediate parent elements for nodes in this dojo.NodeList.
Optionally takes a query to filter the parent elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
parents(
query
: String
) :
void
Returns all parent elements for nodes in this dojo.NodeList.
Optionally takes a query to filter the child elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
place(
queryOrNode
: String||Node
position
: String
) :
void
places elements of this node list relative to the first element matched
Parameter |
Type |
Usage |
Description |
queryOrNode |
String||Node |
required |
may be a string representing any valid CSS3 selector or a DOM node.
In the selector case, only the first matching element will be used
for relative positioning. |
position |
String |
required |
|
|
|
|
|
position(
) :
void
Returns border-box objects (x/y/w/h) of all elements in a node list
as an Array (*not* a NodeList). Acts like dojo.position , though
assumes the node passed is each node in this list.
|
|
|
|
prepend(
content
: String||DOMNode||NodeList
) :
void
prepends the content to every node in the NodeList.
The content will be cloned if the length of NodeList
is greater than 1. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
content |
String||DOMNode||NodeList |
required |
|
|
|
|
|
prependTo(
query
: String
) :
void
prepends nodes in this NodeList to the nodes matched by
the query passed to prependTo.
The nodes in this NodeList will be cloned if the query
matches more than one element. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
query |
String |
required |
|
Examples
|
|
|
|
prev(
query
: String
) :
void
Returns the previous element for nodes in this dojo.NodeList.
Optionally takes a query to filter the previous elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
prevAll(
query
: String
) :
void
Returns all sibling elements that come before the nodes in this dojo.NodeList.
Optionally takes a query to filter the sibling elements.
The returned nodes will be in reverse DOM order -- the first node in the list will
be the node closest to the original node/NodeList.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
query(
queryStr
: String
) :
void
Returns a new list whose memebers match the passed query,
assuming elements of the current NodeList as the root for
each search.
Parameter |
Type |
Usage |
Description |
queryStr |
String |
required |
|
Examples
|
|
|
|
remove(
simpleFilter
: String
) :
void
alias for dojo.NodeList's orphan method. Removes elements
in this list that match the simple filter from their parents
and returns them as a new NodeList.
Parameter |
Type |
Usage |
Description |
simpleFilter |
String |
required |
single-expression CSS rule. For example, ".thinger" or
"#someId[attrName='value']" but not "div > span". In short,
anything which does not invoke a descent to evaluate but
can instead be used to test a single node is acceptable. |
|
|
|
|
removeClass(
className
: String|Array
) :
void
removes the specified class from every node in the list
Parameter |
Type |
Usage |
Description |
className |
String|Array |
optional |
An optional String class name to remove, or several space-separated
class names, or an array of class names. If omitted, all class names
will be deleted. |
|
|
|
|
replaceAll(
query
: String
) :
void
replaces nodes matched by the query passed to replaceAll with the nodes
in this NodeList.
The nodes in this NodeList will be cloned if the query
matches more than one element. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
query |
String |
required |
|
Examples
|
|
|
|
replaceWith(
content
: String||DOMNode||NodeList
) :
void
Replaces each node in ths NodeList with the content passed to replaceWith.
The content will be cloned if the length of NodeList
is greater than 1. Only the DOM nodes are cloned, not
any attached event handlers.
Parameter |
Type |
Usage |
Description |
content |
String||DOMNode||NodeList |
required |
|
Examples
|
|
|
|
siblings(
query
: String
) :
void
Returns all sibling elements for nodes in this dojo.NodeList.
Optionally takes a query to filter the sibling elements.
.end() can be used on the returned dojo.NodeList to get back to the
original dojo.NodeList.
Parameter |
Type |
Usage |
Description |
query |
String |
optional |
a CSS selector. |
Examples
|
|
|
|
slice(
begin
: Integer
end
: Integer
) :
void
Returns a new NodeList, maintaining this one in place
This method behaves exactly like the Array.slice method
with the caveat that it returns a dojo.NodeList and not a
raw Array. For more details, see Mozilla's (slice
Parameter |
Type |
Usage |
Description |
begin |
Integer |
required |
Can be a positive or negative integer, with positive
integers noting the offset to begin at, and negative
integers denoting an offset from the end (i.e., to the left
of the end) |
end |
Integer |
optional |
Optional parameter to describe what position relative to
the NodeList's zero index to end the slice at. Like begin,
can be positive or negative. |
|
|
|
|
slideTo(
args
) :
void
slide all elements of the node list to the specified place.
Returns an instance of dojo.Animation
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
Examples
|
|
|
|
some(
callback
: Function:
thisObject
: Object:
) :
void
Takes the same structure of arguments and returns as
dojo.some() with the caveat that the passed array is
implicitly this NodeList. See dojo.some() and Mozilla's
(Array.some
Parameter |
Type |
Usage |
Description |
callback |
Function: |
required |
the callback |
thisObject |
Object: |
optional |
the context |
|
|
|
|
splice(
index
: Integer
howmany
: Integer
item
: Object
) :
void
Returns a new NodeList, manipulating this NodeList based on
the arguments passed, potentially splicing in new elements
at an offset, optionally deleting elements
This method behaves exactly like the Array.splice method
with the caveat that it returns a dojo.NodeList and not a
raw Array. For more details, see Mozilla's (splice
Parameter |
Type |
Usage |
Description |
index |
Integer |
required |
begin can be a positive or negative integer, with positive
integers noting the offset to begin at, and negative
integers denoting an offset from the end (i.e., to the left
of the end) |
howmany |
Integer |
optional |
Optional parameter to describe what position relative to
the NodeList's zero index to end the slice at. Like begin,
can be positive or negative. |
item |
Object |
optional |
Any number of optional parameters may be passed in to be
spliced into the NodeList |
|
|
|
|
style(
property
: String
value
: String
) :
void
gets or sets the CSS property for every element in the NodeList
Parameter |
Type |
Usage |
Description |
property |
String |
required |
the CSS property to get/set, in JavaScript notation
("lineHieght" instead of "line-height") |
value |
String |
optional |
optional. The value to set the property to |
|
|
|
|
text(
value
: String
) :
void
allows setting the text value of each node in the NodeList,
if there is a value passed in, otherwise, returns the text value for all the
nodes in the NodeList in one string.
Parameter |
Type |
Usage |
Description |
value |
String |
required |
|
Examples
|
|
|
|
toggleClass(
className
: String
condition
: Boolean
) :
void
Adds a class to node if not present, or removes if present.
Pass a boolean condition if you want to explicitly add or remove.
Parameter |
Type |
Usage |
Description |
className |
String |
required |
the CSS class to add |
condition |
Boolean |
optional |
If passed, true means to add the class, false means to remove. |
|
|
|
|
val(
value
: String||Array
) :
void
If a value is passed, allows seting the value property of form elements in this
NodeList, or properly selecting/checking the right value for radio/checkbox/select
elements. If no value is passed, the value of the first node in this NodeList
is returned.
Parameter |
Type |
Usage |
Description |
value |
String||Array |
required |
|
Examples
|
|
|
|
wipeIn(
args
) :
void
wipe in all elements of this NodeList. Returns an instance of dojo.Animation
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
Examples
|
|
|
|
wipeOut(
args
) :
void
wipe out all elements of this NodeList. Returns an instance of dojo.Animation
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
Examples
|
|
|
|
wrap(
html
: String||DOMNode
) :
void
Wrap each node in the NodeList with html passed to wrap.
html will be cloned if the NodeList has more than one
element. Only DOM nodes are cloned, not any attached
event handlers.
Parameter |
Type |
Usage |
Description |
html |
String||DOMNode |
required |
|
Examples
|
|
|
|
wrapAll(
html
: String||DOMNode
) :
void
Insert html where the first node in this NodeList lives, then place all
nodes in this NodeList as the child of the html.
Parameter |
Type |
Usage |
Description |
html |
String||DOMNode |
required |
|
Examples
|
|
|
|
wrapInner(
html
: String||DOMNode
) :
void
For each node in the NodeList, wrap all its children with the passed in html.
html will be cloned if the NodeList has more than one
element. Only DOM nodes are cloned, not any attached
event handlers.
Parameter |
Type |
Usage |
Description |
html |
String||DOMNode |
required |
|
Examples
|