webgui/www/extras/yui/docs/autocomplete/YAHOO.widget.DataSource.html
JT Smith 4f68a0933c added YUI and YUI-ext
fixed the resizable text area with IE problem
fixed the ad space with IE problem
merged the 7.2.0 and 7.1.4 change logs
2006-11-07 23:15:57 +00:00

819 lines
21 KiB
HTML

<html>
<head>
<title>JavaScript Documentation - </title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>JavaScript Documentation</h1>
<h3><a href="./index.html">AutoComplete</a></h3>
<div class="breadcrumbs">
<a href="./index.html">AutoComplete</a>
&gt;
<strong>YAHOO.widget.DataSource</strong>
</div>
</div>
<div id="body">
<div class="nav">
<div class="module resources">
<ul class="content">
<li><a href="overview-tree.html">Tree View</a></li>
<li><a href="index-all.html">Element Index</a></li>
</ul>
</div>
<div class="module">
<h4><a href="./allclasses-noframe.html">Classes</a></h4>
<ul class="content">
<li>
<a href="YAHOO.widget.html">
YAHOO.widget</a>
</li>
<li>
<a href="YAHOO.widget.AutoComplete.html">
YAHOO.widget.AutoComplete</a>
</li>
<li>
<a href="YAHOO.widget.DataSource.html">
YAHOO.widget.DataSource</a>
</li>
<li>
<a href="YAHOO.widget.DS_JSArray.html">
YAHOO.widget.DS_JSArray</a>
</li>
<li>
<a href="YAHOO.widget.DS_JSFunction.html">
YAHOO.widget.DS_JSFunction</a>
</li>
<li>
<a href="YAHOO.widget.DS_XHR.html">
YAHOO.widget.DS_XHR</a>
</li>
</ul>
</div>
<div class="module">
<h4><a href="./overview-summary.html">Files</a></h4>
<ul class="content">
<li>
<a href="overview-summary-AutoComplete.js.html">
AutoComplete.js</a>
</li>
<li>
<a href="overview-summary-DataSource.js.html">
DataSource.js</a>
</li>
</ul>
</div>
</div>
<div id="pri">
<div class="main">
<h2>Class YAHOO.widget.DataSource</h2>
<pre>Object
|
+--<b>YAHOO.widget.DataSource</b>
</pre>
<dl class="subclasses">
<dt>Direct Known Subclasses:</dd>
<dd>
<a href="YAHOO.widget.DS_XHR.html">YAHOO.widget.DS_XHR</a>, <a href="YAHOO.widget.DS_JSArray.html">YAHOO.widget.DS_JSArray</a>, <a href="YAHOO.widget.DS_JSFunction.html">YAHOO.widget.DS_JSFunction</a>
</dd>
</dl>
<hr />
<!-- Class definition -->
<div class="class-def">
<div class="class-name">
<span class="class-attribs">
</span>
<span class="class-type">class</span>
<b>YAHOO.widget.DataSource</b>
</div>
<div class="class-extends">
</div>
</div>
<div class="meta">
</div>
<!-- ======== QUICK LINKS ======== -->
<div class="quick-links">
<strong>Quick Links:</strong>&nbsp;
<a href="#field_summary">Field Summary</a>
|
<a href="#constructor_summary">Constructor Summary</a>
|
<a href="#methodSummary">Method Summary</a> |
<a href="#methodDetails">Method Details</a>
</div>
<!-- ======== END QUICK LINKS ======== -->
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- ======== END NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<div class="section field summaries">
<h3><a name="field_summary">Field Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#cacheFlushEvent">cacheFlushEvent</a>
</code>
<div class="description">
Fired when the local cache is flushed.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#cacheQueryEvent">cacheQueryEvent</a>
</code>
<div class="description">
Fired when a query is made to the local cache.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#dataErrorEvent">dataErrorEvent</a>
</code>
<div class="description">
Fired when an error is encountered with the live data source.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">constant</td>
<td class="spec">
<code>
<a href="#ERROR_DATANULL">ERROR_DATANULL</a>
</code>
<div class="description">
Error message for null data responses.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">constant</td>
<td class="spec">
<code>
<a href="#ERROR_DATAPARSE">ERROR_DATAPARSE</a>
</code>
<div class="description">
Error message for data responses with parsing errors.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getCachedResultsEvent">getCachedResultsEvent</a>
</code>
<div class="description">
Fired when data is retrieved from the local cache.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getResultsEvent">getResultsEvent</a>
</code>
<div class="description">
Fired when data is retrieved from the live data source.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">number</td>
<td class="spec">
<code>
<a href="#maxCacheEntries">maxCacheEntries</a>
</code>
<div class="description">
Max size of the local cache.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#queryEvent">queryEvent</a>
</code>
<div class="description">
Fired when a query is made to the live data source.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#queryMatchCase">queryMatchCase</a>
</code>
<div class="description">
Data source query case-sensitivity matching.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#queryMatchContains">queryMatchContains</a>
</code>
<div class="description">
Use this to equate cache matching with the type of matching done by your live
data source.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#queryMatchSubset">queryMatchSubset</a>
</code>
<div class="description">
Data source query subset matching.&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- =========== END FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<div class="section contructor summaries">
<h3><a name="constructor_summary">Constructor Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<code class="spec">
<a href="YAHOO.widget.DataSource.html#YAHOO.widget.DataSource()">YAHOO.widget.DataSource</a>
</code>
<div class="description">
Class providing encapsulation of a data source.&nbsp;
</div>
</div>
</div>
<!-- ======== END CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<div class="section method summaries">
<h3><a name="methodSummary">Method Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#doQuery">doQuery</a>
(&lt;object&gt; oCallbackFn, &lt;string&gt; sQuery, &lt;object&gt; oParent)
</code>
<div class="description">
Abstract method implemented by subclasses to make a query to the live data
source.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#flushCache">flushCache</a>
()
</code>
<div class="description">
Flushes cache.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#getResults">getResults</a>
(&lt;object&gt; oCallbackFn, &lt;string&gt; sQuery, &lt;object&gt; oParent)
</code>
<div class="description">
Retrieves query results, first checking the local cache, then making the
query request to the live data source as defined by the function doQuery.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#toString">toString</a>
()
</code>
<div class="description">
Public accessor to the unique name of the data source instance.&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- ========== END METHOD SUMMARY =========== -->
<!-- ============ FIELD DETAIL START =========== -->
<div class="section field details">
<h3><a name="field_detail">Field Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="cacheFlushEvent">cacheFlushEvent</a></h4>
<div class="detail">
<code>
Object
&nbsp;
<strong>cacheFlushEvent</strong>
</code>
<div class="description">
Fired when the local cache is flushed. Subscribers receive the following
array :<br>
- args[0] The data source instance
</div>
</div>
<hr />
<h4><a name="cacheQueryEvent">cacheQueryEvent</a></h4>
<div class="detail">
<code>
Object
&nbsp;
<strong>cacheQueryEvent</strong>
</code>
<div class="description">
Fired when a query is made to the local cache. Subscribers receive the
following array:<br>
- args[0] The data source instance
- args[1] The requesting object
- args[2] The query string
</div>
</div>
<hr />
<h4><a name="dataErrorEvent">dataErrorEvent</a></h4>
<div class="detail">
<code>
Object
&nbsp;
<strong>dataErrorEvent</strong>
</code>
<div class="description">
Fired when an error is encountered with the live data source. Subscribers
receive the following array:<br>
- args[0] The data source instance
- args[1] The requesting object
- args[2] The query string
- args[3] Error message string
</div>
</div>
<hr />
<h4><a name="ERROR_DATANULL">ERROR_DATANULL</a></h4>
<div class="detail">
<code>
constant
&nbsp;
<strong>ERROR_DATANULL</strong>
</code>
<div class="description">
Error message for null data responses.
</div>
</div>
<hr />
<h4><a name="ERROR_DATAPARSE">ERROR_DATAPARSE</a></h4>
<div class="detail">
<code>
constant
&nbsp;
<strong>ERROR_DATAPARSE</strong>
</code>
<div class="description">
Error message for data responses with parsing errors.
</div>
</div>
<hr />
<h4><a name="getCachedResultsEvent">getCachedResultsEvent</a></h4>
<div class="detail">
<code>
Object
&nbsp;
<strong>getCachedResultsEvent</strong>
</code>
<div class="description">
Fired when data is retrieved from the local cache. Subscribers receive the
following array :<br>
- args[0] The data source instance
- args[1] The requesting object
- args[2] The query string
- args[3] Array of result objects
</div>
</div>
<hr />
<h4><a name="getResultsEvent">getResultsEvent</a></h4>
<div class="detail">
<code>
Object
&nbsp;
<strong>getResultsEvent</strong>
</code>
<div class="description">
Fired when data is retrieved from the live data source. Subscribers receive
the following array:<br>
- args[0] The data source instance
- args[1] The requesting object
- args[2] The query string
- args[3] Array of result objects
</div>
</div>
<hr />
<h4><a name="maxCacheEntries">maxCacheEntries</a></h4>
<div class="detail">
<code>
number
&nbsp;
<strong>maxCacheEntries</strong>
</code>
<div class="description">
Max size of the local cache. Set to 0 to turn off caching. Caching is
useful to reduce the number of server connections. Recommended only for data
sources that return comprehensive results for queries or when stale data is
not an issue. Default: 15.
</div>
</div>
<hr />
<h4><a name="queryEvent">queryEvent</a></h4>
<div class="detail">
<code>
Object
&nbsp;
<strong>queryEvent</strong>
</code>
<div class="description">
Fired when a query is made to the live data source. Subscribers receive the
following array:<br>
- args[0] The data source instance
- args[1] The requesting object
- args[2] The query string
</div>
</div>
<hr />
<h4><a name="queryMatchCase">queryMatchCase</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>queryMatchCase</strong>
</code>
<div class="description">
Data source query case-sensitivity matching. If caching is on and
queryMatchCase is true, queries will only return results for case-sensitive
matches. Default: false.
</div>
</div>
<hr />
<h4><a name="queryMatchContains">queryMatchContains</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>queryMatchContains</strong>
</code>
<div class="description">
Use this to equate cache matching with the type of matching done by your live
data source. If caching is on and queryMatchContains is true, the cache
returns results that "contain" the query string. By default,
queryMatchContains is set to false, meaning the cache only returns results
that "start with" the query string. Default: false.
</div>
</div>
<hr />
<h4><a name="queryMatchSubset">queryMatchSubset</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>queryMatchSubset</strong>
</code>
<div class="description">
Data source query subset matching. If caching is on and queryMatchSubset is
true, substrings of queries will return matching cached results. For
instance, if the first query is for "abc" susequent queries that start with
"abc", like "abcd", will be queried against the cache, and not the live data
source. Recommended only for data sources that return comprehensive results
for queries with very few characters. Default: false.
</div>
</div>
<hr />
</div>
</div>
<!-- ============ FIELD DETAIL END =========== -->
<!-- ========= CONSTRUCTOR DETAIL START ======== -->
<div class="section constructor details">
<h3><a name="constructor_detail">Constructor Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="YAHOO.widget.DataSource()">YAHOO.widget.DataSource</a></h4>
<div class="detail">
<code>
<strong>YAHOO.widget.DataSource</strong>
()
</code>
<div class="description">
Class providing encapsulation of a data source.
</div>
</div>
</div>
</div>
<!-- ========= CONSTRUCTOR DETAIL END ======== -->
<!-- ============ METHOD DETAIL START ========== -->
<div class="section method details">
<h3><a name="methodDetails">Method Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="doQuery">doQuery</a></h4>
<div class="detail">
<code>
void
<strong>doQuery</strong>
(&lt;object&gt; oCallbackFn, &lt;string&gt; sQuery, &lt;object&gt; oParent)
</code>
<div class="description">
Abstract method implemented by subclasses to make a query to the live data
source. Must call the callback function with the response returned from the
query. Populates cache (if enabled).
<dl>
<dt>Parameters:</dt>
<dd>
<code>oCallbackFn</code> -
Callback function implemented by oParent to which to return results
</dd>
<dd>
<code>sQuery</code> -
Query string
</dd>
<dd>
<code>oParent</code> -
The object instance that has requested data
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="flushCache">flushCache</a></h4>
<div class="detail">
<code>
void
<strong>flushCache</strong>
()
</code>
<div class="description">
Flushes cache.
</div>
</div>
<hr />
<h4><a name="getResults">getResults</a></h4>
<div class="detail">
<code>
void
<strong>getResults</strong>
(&lt;object&gt; oCallbackFn, &lt;string&gt; sQuery, &lt;object&gt; oParent)
</code>
<div class="description">
Retrieves query results, first checking the local cache, then making the
query request to the live data source as defined by the function doQuery.
<dl>
<dt>Parameters:</dt>
<dd>
<code>oCallbackFn</code> -
Callback function defined by oParent object to which to return results
</dd>
<dd>
<code>sQuery</code> -
Query string
</dd>
<dd>
<code>oParent</code> -
The object instance that has requested data
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="toString">toString</a></h4>
<div class="detail">
<code>
string
<strong>toString</strong>
()
</code>
<div class="description">
Public accessor to the unique name of the data source instance.
<dl>
<dt>Returns:</dt>
<dd> Unique name of the data source instance</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
<!-- ============ METHOD DETAIL END ========== -->
</div>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<div id="footer">
<hr />
Copyright &copy; 2006 Yahoo! Inc. All rights reserved.
<br />
Documentation generated by <a href="http://jsdoc.sourceforge.net/">JSDoc</a>
</div>
</body>
</html>