webgui/www/extras/yui/docs/YAHOO.widget.DualSlider.html
JT Smith 20f8df1291 upgrading to YUI 2.6
data tables are going to need some work yet, but the other stuff seems to be working 100%
2008-10-22 23:53:29 +00:00

1332 lines
63 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>API: slider YAHOO.widget.DualSlider (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>Slider Widget&nbsp; <span class="subtitle">2.6.0</span></h3>
<p>
<a href="./index.html">Yahoo! UI Library</a>
&gt; <a href="./module_slider.html">slider</a>
&gt; YAHOO.widget.DualSlider
</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" /> <label for="showprivate">Show Private</label></span>
<span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> <label for="showprotected">Show Protected</label></span>
<span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> <label for="showdeprecated">Show Deprecated</label></span>
</form>
<h2>
Class <b>YAHOO.widget.DualSlider</b>
<span class="extends">
</span>
<span class="extends">
- uses
<a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>
</span>
</code>
</h2>
<!-- class tree goes here -->
<div class="summary description">
A slider with two thumbs, one that represents the min value and
the other the max. Actually a composition of two sliders, both with
the same background. The constraints for each slider are adjusted
dynamically so that the min value of the max slider is equal or greater
to the current value of the min slider, and the max value of the min
slider is the current value of the max slider.
Constructor assumes both thumbs are positioned absolutely at the 0 mark on
the background.
</div>
<div class="section constructor details">
<h3 id="constructor">Constructor</h3>
<div class="content">
<div class="detail">
<strong>YAHOO.widget.DualSlider</strong>
<code>
(
minSlider
,
maxSlider
,
range
,
initVals
)
</code>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>minSlider
&lt;Slider&gt;
</code>
The Slider instance used for the min value thumb
</dd>
<dd>
<code>maxSlider
&lt;Slider&gt;
</code>
The Slider instance used for the max value thumb
</dd>
<dd>
<code>range
&lt;int&gt;
</code>
The number of pixels the thumbs may move within
</dd>
<dd>
<code>initVals
&lt;Array&gt;
</code>
(optional) [min,max] Initial thumb placement
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="section field details">
<h3 id="properties">Properties</h3>
<div class="content">
<div class="">
<h4><a name="property_activeSlider">activeSlider</a>
<code>- Slider</code>
</h4>
<div class="detail">
<div class="description">
The currently active slider (min or max). <strong>read only</strong>
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="property_isHoriz">isHoriz</a>
<code>- boolean</code>
</h4>
<div class="detail">
<div class="description">
Is the DualSlider oriented horizontally or vertically?
<strong>read only</strong>
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="property_maxSlider">maxSlider</a>
<code>- Slider</code>
</h4>
<div class="detail">
<div class="description">
A slider instance that keeps track of the upper value of the range.
<strong>read only</strong>
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="property_maxVal">maxVal</a>
<code>- int</code>
</h4>
<div class="detail">
<div class="description">
The current value of the max thumb. <strong>read only</strong>.
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="property_minRange">minRange</a>
<code>- int</code>
</h4>
<div class="detail">
<div class="description">
Pixel distance to maintain between thumbs.
</div>
</div>
<div class="default">
Default Value: 0
</div>
<hr />
</div>
<div class="">
<h4><a name="property_minSlider">minSlider</a>
<code>- Slider</code>
</h4>
<div class="detail">
<div class="description">
A slider instance that keeps track of the lower value of the range.
<strong>read only</strong>
</div>
</div>
<hr />
</div>
<div class="">
<h4><a name="property_minVal">minVal</a>
<code>- int</code>
</h4>
<div class="detail">
<div class="description">
The current value of the min thumb. <strong>read only</strong>.
</div>
</div>
<hr />
</div>
</div>
</div>
<div class="section field inheritance">
<h4>Properties inherited from <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>:</h4>
<div class="content">
<code>
<a class="private" href="YAHOO.util.EventProvider.html#property___yui_events">__yui_events</a><span class="private">,</span>
<a class="private" href="YAHOO.util.EventProvider.html#property___yui_subscribers">__yui_subscribers</a>
</code>
</div>
</div>
<div class="section method details">
<h3 id="methods">Methods</h3>
<div class="content">
<div class="private">
<h4>
<a name="method__cleanEvent">_cleanEvent</a></h4>
<div class="detail">
<code>
private
void
<strong>_cleanEvent</strong>
(
o
,
evt
)
</code>
<div class="description">
Clean up the slideEnd event subscribers array, since each one-time
callback will be replaced in the event's subscribers property with
null. This will cause memory bloat and loss of performance.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>o &lt;EventProvider&gt;</code>
object housing the CustomEvent
</dd>
<dd>
<code>evt &lt;string&gt;</code>
name of the CustomEvent
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method__handleDrag">_handleDrag</a></h4>
<div class="detail">
<code>
private
void
<strong>_handleDrag</strong>
(
)
</code>
<div class="description">
Overrides the onDrag method for both sliders
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method__handleMaxChange">_handleMaxChange</a></h4>
<div class="detail">
<code>
private
void
<strong>_handleMaxChange</strong>
(
)
</code>
<div class="description">
Executed when the max slider fires the change event
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method__handleMinChange">_handleMinChange</a></h4>
<div class="detail">
<code>
private
void
<strong>_handleMinChange</strong>
(
)
</code>
<div class="description">
Executed when the min slider fires the change event
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method__handleSlideEnd">_handleSlideEnd</a></h4>
<div class="detail">
<code>
private
void
<strong>_handleSlideEnd</strong>
(
)
</code>
<div class="description">
Executed when one of the sliders fires the slideEnd event
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method__handleSlideStart">_handleSlideStart</a></h4>
<div class="detail">
<code>
private
void
<strong>_handleSlideStart</strong>
(
)
</code>
<div class="description">
Executed when one of the sliders fires the slideStart event
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method__oneTimeCallback">_oneTimeCallback</a></h4>
<div class="detail">
<code>
private
void
<strong>_oneTimeCallback</strong>
(
o
,
evt
,
fn
)
</code>
<div class="description">
Schedule an event callback that will execute once, then unsubscribe
itself.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>o &lt;EventProvider&gt;</code>
Object to attach the event to
</dd>
<dd>
<code>evt &lt;string&gt;</code>
Name of the event
</dd>
<dd>
<code>fn &lt;Function&gt;</code>
function to execute once
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method_handleMouseDown">handleMouseDown</a></h4>
<div class="detail">
<code>
private
void
<strong>handleMouseDown</strong>
(
)
</code>
<div class="description">
Overrides the onMouseDown for both slider, only moving the active slider
</div>
<div class="description">
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method_selectActiveSlider">selectActiveSlider</a></h4>
<div class="detail">
<code>
private
void
<strong>selectActiveSlider</strong>
(
e
)
</code>
<div class="description">
A background click will move the slider thumb nearest to the click.
Override if you need different behavior.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>e &lt;Event&gt;</code>
the mousedown event
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="method_setMaxValue">setMaxValue</a></h4>
<div class="detail">
<code>
void
<strong>setMaxValue</strong>
(
max
,
skipAnim
,
force
,
silent
)
</code>
<div class="description">
Set the max thumb position to a new value.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>max &lt;int&gt;</code>
Pixel offset for max thumb
</dd>
<dd>
<code>skipAnim &lt;boolean&gt;</code>
(optional) Set to true to skip thumb animation.
Default false
</dd>
<dd>
<code>force &lt;boolean&gt;</code>
(optional) ignore the locked setting and set
value anyway. Default false
</dd>
<dd>
<code>silent &lt;boolean&gt;</code>
(optional) Set to true to skip firing change
events. Default false
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="method_setMinValue">setMinValue</a></h4>
<div class="detail">
<code>
void
<strong>setMinValue</strong>
(
min
,
skipAnim
,
force
,
silent
)
</code>
<div class="description">
Set the min thumb position to a new value.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>min &lt;int&gt;</code>
Pixel offset for min thumb
</dd>
<dd>
<code>skipAnim &lt;boolean&gt;</code>
(optional) Set to true to skip thumb animation.
Default false
</dd>
<dd>
<code>force &lt;boolean&gt;</code>
(optional) ignore the locked setting and set
value anyway. Default false
</dd>
<dd>
<code>silent &lt;boolean&gt;</code>
(optional) Set to true to skip firing change
events. Default false
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="method_setValues">setValues</a></h4>
<div class="detail">
<code>
void
<strong>setValues</strong>
(
min
,
max
,
skipAnim
,
force
,
silent
)
</code>
<div class="description">
Sets the min and max thumbs to new values.
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>min &lt;int&gt;</code>
Pixel offset to assign to the min thumb
</dd>
<dd>
<code>max &lt;int&gt;</code>
Pixel offset to assign to the max thumb
</dd>
<dd>
<code>skipAnim &lt;boolean&gt;</code>
(optional) Set to true to skip thumb animation.
Default false
</dd>
<dd>
<code>force &lt;boolean&gt;</code>
(optional) ignore the locked setting and set
value anyway. Default false
</dd>
<dd>
<code>silent &lt;boolean&gt;</code>
(optional) Set to true to skip firing change
events. Default false
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private">
<h4>
<a name="method_updateValue">updateValue</a></h4>
<div class="detail">
<code>
private
void
<strong>updateValue</strong>
(
silent
)
</code>
<div class="description">
Executed when one of the sliders is moved
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>silent &lt;boolean&gt;</code>
(optional) Set to true to skip firing change
events. Default false
</dd>
</dl>
<dl>
<dt>Returns:
<code>
void
</code></dt>
<dd></dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
<div class="section field inheritance">
<h4>Methods inherited from <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>:</h4>
<div class="content">
<code>
<a class="" href="YAHOO.util.EventProvider.html#method_createEvent">createEvent</a><span class="">,</span> <a class="" href="YAHOO.util.EventProvider.html#method_fireEvent">fireEvent</a><span class="">,</span> <a class="" href="YAHOO.util.EventProvider.html#method_hasEvent">hasEvent</a><span class="">,</span> <a class="" href="YAHOO.util.EventProvider.html#method_subscribe">subscribe</a><span class="">,</span> <a class="" href="YAHOO.util.EventProvider.html#method_unsubscribe">unsubscribe</a><span class="">,</span> <a class="" href="YAHOO.util.EventProvider.html#method_unsubscribeAll">unsubscribeAll</a>
</code>
</div>
</div>
<div class="section method details">
<h3 id="events">Events</h3>
<div class="content">
<div class="">
<h4>
<a name="event_change">change</a></h4>
<div class="detail">
<code>
<strong>change</strong>
(
dualslider
)
</code>
<div class="description">
Event that fires when either the min or max value changes
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>dualslider &lt;DualSlider&gt;</code>
the DualSlider instance
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="event_ready">ready</a></h4>
<div class="detail">
<code>
<strong>ready</strong>
(
dualslider
)
</code>
<div class="description">
Event that fires when the slider is finished setting up
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>dualslider &lt;DualSlider&gt;</code>
the DualSlider instance
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="event_slideEnd">slideEnd</a></h4>
<div class="detail">
<code>
<strong>slideEnd</strong>
(
activeSlider
)
</code>
<div class="description">
Event that fires when one of the thumbs finishes moving
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>activeSlider &lt;Slider&gt;</code>
the moving slider
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="">
<h4>
<a name="event_slideStart">slideStart</a></h4>
<div class="detail">
<code>
<strong>slideStart</strong>
(
activeSlider
)
</code>
<div class="description">
Event that fires when one of the thumbs begins to move
</div>
<div class="description">
<dl>
<dt>Parameters:</dt>
<dd>
<code>activeSlider &lt;Slider&gt;</code>
the moving slider
</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_carousel.html">carousel</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_paginator.html">paginator</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=""><a href="module_selector.html">selector</a></li>
<li class="selected"><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.widget.DualSlider.html">YAHOO.widget.DualSlider</a></li>
<li class=""><a href="YAHOO.widget.Slider.html">YAHOO.widget.Slider</a></li>
<li class=""><a href="YAHOO.widget.SliderThumb.html">YAHOO.widget.SliderThumb</a></li>
</ul>
</div>
<div class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="DualSlider.js.html">DualSlider.js</a></li>
<li class=""><a href="Slider.js.html">Slider.js</a></li>
<li class=""><a href="SliderThumb.js.html">SliderThumb.js</a></li>
</ul>
</div>
<div class="module">
<h4>Properties</h4>
<ul class="content">
<li class=""><a href="#property_activeSlider">activeSlider</a>
<!--<code>&lt;int&gt;</code>-->
</li>
<li class=""><a href="#property_isHoriz">isHoriz</a>
<!--<code>&lt;int&gt;</code>-->
</li>
<li class=""><a href="#property_maxSlider">maxSlider</a>
<!--<code>&lt;int&gt;</code>-->
</li>
<li class=""><a href="#property_maxVal">maxVal</a>
<!--<code>&lt;int&gt;</code>-->
</li>
<li class=""><a href="#property_minRange">minRange</a>
<!--<code>&lt;int&gt;</code>-->
</li>
<li class=""><a href="#property_minSlider">minSlider</a>
<!--<code>&lt;int&gt;</code>-->
</li>
<li class=""><a href="#property_minVal">minVal</a>
<!--<code>&lt;int&gt;</code>-->
</li>
</ul>
</div>
<div class="module">
<h4>Methods</h4>
<ul class="content">
<li class="private"><!--<code>void</code>-->
<a href="#method__cleanEvent">_cleanEvent</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method__handleDrag">_handleDrag</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method__handleMaxChange">_handleMaxChange</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method__handleMinChange">_handleMinChange</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method__handleSlideEnd">_handleSlideEnd</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method__handleSlideStart">_handleSlideStart</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method__oneTimeCallback">_oneTimeCallback</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method_handleMouseDown">handleMouseDown</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method_selectActiveSlider">selectActiveSlider</a>
</li>
<li class=""><!--<code>void</code>-->
<a href="#method_setMaxValue">setMaxValue</a>
</li>
<li class=""><!--<code>void</code>-->
<a href="#method_setMinValue">setMinValue</a>
</li>
<li class=""><!--<code>void</code>-->
<a href="#method_setValues">setValues</a>
</li>
<li class="private"><!--<code>void</code>-->
<a href="#method_updateValue">updateValue</a>
</li>
</ul>
</div>
<div class="module">
<h4>Events</h4>
<ul class="content">
<li class="">
<a href="#event_change">change</a>
</li>
<li class="">
<a href="#event_ready">ready</a>
</li>
<li class="">
<a href="#event_slideEnd">slideEnd</a>
</li>
<li class="">
<a href="#event_slideStart">slideStart</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright &copy; 2008 Yahoo! Inc. All rights reserved.
</div>
</div>
</body>
</html>