webgui/www/extras/yui/docs/YAHOO.util.Selector.html
2008-03-15 17:21:21 +00:00

510 lines
23 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>API: selector YAHOO.util.Selector (YUI Library)</title>
<link rel="stylesheet" type="text/css" href="assets/api.css">
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
<h3>Selector Utility&nbsp; <span class="subtitle">2.5.0</span></h3>
<p>
<a href="./index.html">Yahoo! UI Library</a>
&gt; <a href="./module_selector.html">selector</a>
&gt; YAHOO.util.Selector
</p>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form name="yui-classopts-form">
<span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> Show Private</span>
<span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> Show Protected</span>
</form>
<h2>
<code>static</code>
Class <b>YAHOO.util.Selector</b>
<span class="extends">
</span>
<span class="extends">
</span>
</code>
</h2>
<!-- class tree goes here -->
<div class="summary description">
Provides helper methods for collecting and filtering DOM elements.
</div>
<div class="section field details">
<h3 id="properties">Properties</h3>
<div class="content">
<div class="">
<h4><a name="attrAliases">attrAliases</a>
<code>- object</code>
</h4>
<div class="detail">
<div class="description">
Mapping of attributes to aliases, normally to work around HTMLAttributes
that conflict with JS reserved words.
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="document">document</a>
<code>- object</code>
</h4>
<div class="detail">
<div class="description">
Default document for use queries
</div>
</div>
<div class="default">
Default Value: window.document
</div>
<hr />
</div>
<div class="">
<h4><a name="operators">operators</a>
<code>- object</code>
</h4>
<div class="detail">
<div class="description">
List of operators and corresponding boolean functions.
These functions are passed the attribute and the current node's value of the attribute.
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="pseudos">pseudos</a>
<code>- object</code>
</h4>
<div class="detail">
<div class="description">
List of pseudo-classes and corresponding boolean functions.
These functions are called with the current node, and any value that was parsed with the pseudo regex.
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="shorthand">shorthand</a>
<code>- object</code>
</h4>
<div class="detail">
<div class="description">
Mapping of shorthand tokens to corresponding attribute selector
</div>
</div>
<hr />
</div>
</div>
</div>
<div class="section method details">
<h3 id="methods">Methods</h3>
<div class="content">
<div class="">
<h4>
<a name="filter">filter</a></h4>
<div class="detail">
<code>
static
array
<strong>filter</strong>
(
A
,
selector
)
</code>
<div class="description">
Filters a set of nodes based on a given CSS selector.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>A &lt;array&gt;</code>
set of nodes/ids to filter.
</dd>
<dd>
<code>selector &lt;string&gt;</code>
The selector used to test each node.
</dd>
</dl>
<dl>
<dt>Returns:
<code>
array
</code></dt>
<dd>An array of nodes from the supplied array that match the given selector.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="query">query</a></h4>
<div class="detail">
<code>
static
Array
<strong>query</strong>
(
selector
,
root
,
firstOnly
)
</code>
<div class="description">
Retrieves a set of nodes based on a given CSS selector.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>selector &lt;string&gt;</code>
The CSS Selector to test the node against.
</dd>
<dd>
<code>root &lt;HTMLElement | String&gt;</code>
optional An id or HTMLElement to start the query from. Defaults to Selector.document.
</dd>
<dd>
<code>firstOnly &lt;Boolean&gt;</code>
optional Whether or not to return only the first match.
</dd>
</dl>
<dl>
<dt>Returns:
<code>
Array
</code></dt>
<dd>An array of nodes that match the given selector.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="test">test</a></h4>
<div class="detail">
<code>
static
boolean
<strong>test</strong>
(
node
,
selector
)
</code>
<div class="description">
Test if the supplied node matches the supplied selector.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>node &lt;HTMLElement | String&gt;</code>
An id or node reference to the HTMLElement being tested.
</dd>
<dd>
<code>selector &lt;string&gt;</code>
The CSS Selector to test the node against.
</dd>
</dl>
<dl>
<dt>Returns:
<code>
boolean
</code></dt>
<dd>Whether or not the node matches the selector.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="tokenize">tokenize</a></h4>
<div class="detail">
<code>
void
<strong>tokenize</strong>
(
)
</code>
<div class="description">
Break selector into token units per simple selector.
Combinator is attached to left-hand selector.
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_animation.html">animation</a></li>
<li class=""><a href="module_autocomplete.html">autocomplete</a></li>
<li class=""><a href="module_button.html">button</a></li>
<li class=""><a href="module_calendar.html">calendar</a></li>
<li class=""><a href="module_charts.html">charts</a></li>
<li class=""><a href="module_colorpicker.html">colorpicker</a></li>
<li class=""><a href="module_connection.html">connection</a></li>
<li class=""><a href="module_container.html">container</a></li>
<li class=""><a href="module_cookie.html">cookie</a></li>
<li class=""><a href="module_datasource.html">datasource</a></li>
<li class=""><a href="module_datatable.html">datatable</a></li>
<li class=""><a href="module_dom.html">dom</a></li>
<li class=""><a href="module_dragdrop.html">dragdrop</a></li>
<li class=""><a href="module_editor.html">editor</a></li>
<li class=""><a href="module_element.html">element</a></li>
<li class=""><a href="module_event.html">event</a></li>
<li class=""><a href="module_get.html">get</a></li>
<li class=""><a href="module_history.html">history</a></li>
<li class=""><a href="module_imagecropper.html">imagecropper</a></li>
<li class=""><a href="module_imageloader.html">imageloader</a></li>
<li class=""><a href="module_json.html">json</a></li>
<li class=""><a href="module_layout.html">layout</a></li>
<li class=""><a href="module_logger.html">logger</a></li>
<li class=""><a href="module_menu.html">menu</a></li>
<li class=""><a href="module_profiler.html">profiler</a></li>
<li class=""><a href="module_profilerviewer.html">profilerviewer</a></li>
<li class=""><a href="module_resize.html">resize</a></li>
<li class="selected"><a href="module_selector.html">selector</a></li>
<li class=""><a href="module_slider.html">slider</a></li>
<li class=""><a href="module_tabview.html">tabview</a></li>
<li class=""><a href="module_treeview.html">treeview</a></li>
<li class=""><a href="module_uploader.html">uploader</a></li>
<li class=""><a href="module_yahoo.html">yahoo</a></li>
<li class=""><a href="module_yuiloader.html">yuiloader</a></li>
<li class=""><a href="module_yuitest.html">yuitest</a></li>
</ul>
</div>
<div class="module">
<h4>Classes</h4>
<ul class="content">
<li class="selected"><a href="YAHOO.util.Selector.html">YAHOO.util.Selector</a></li>
</ul>
</div>
<div class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="Selector.js.html">Selector.js</a></li>
</ul>
</div>
<div class="module">
<h4>Properties</h4>
<ul class="content">
<li class=""><a href="#attrAliases">attrAliases</a>
<!--<code>&lt;object&gt;</code>-->
</li>
<li class=""><a href="#document">document</a>
<!--<code>&lt;object&gt;</code>-->
</li>
<li class=""><a href="#operators">operators</a>
<!--<code>&lt;object&gt;</code>-->
</li>
<li class=""><a href="#pseudos">pseudos</a>
<!--<code>&lt;object&gt;</code>-->
</li>
<li class=""><a href="#shorthand">shorthand</a>
<!--<code>&lt;object&gt;</code>-->
</li>
</ul>
</div>
<div class="module">
<h4>Methods</h4>
<ul class="content">
<li class=""><!--<code>array</code>-->
<a href="#filter">filter</a>
</li>
<li class=""><!--<code>Array</code>-->
<a href="#query">query</a>
</li>
<li class=""><!--<code>boolean</code>-->
<a href="#test">test</a>
</li>
<li class=""><!--<code>void</code>-->
<a href="#tokenize">tokenize</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
</div>
</div>
</body>
</html>