number |
connTimeout
Number of milliseconds the XHR connection will wait for a server response.
|
constant |
ERROR_DATAXHR
Error message for XHR failure.
|
string |
responseStripAfter
String after which to strip results.
|
type |
responseType
XHR response data type.
|
Object |
schema
|
string |
scriptQueryAppend
String of key/value pairs to append to requests made to scriptURI.
|
string |
scriptQueryParam
Query string parameter name sent to scriptURI.
|
string |
scriptURI
Absolute or relative URI to script that returns query results.
|
constant |
TYPE_FLAT
Flat file data type
|
constant |
TYPE_JSON
JSON data type
|
constant |
TYPE_XML
XML data type
|
Class YAHOO.widget.DS_XHR
Object | +--YAHOO.widget.DataSource | +--YAHOO.widget.DS_XHR
class
YAHOO.widget.DS_XHR
Field Summary [top]
Fields inherited from class YAHOO.widget.DataSource [top]
Constructor Summary [top]
YAHOO.widget.DS_XHR
Implementation of YAHOO.widget.DataSource using XML HTTP requests that return
query results.
Method Summary [top]
void |
doQuery
(<object> oCallbackFn, <string> sQuery, <object> oParent)
Queries the live data source defined by scriptURI for results.
|
array |
parseResponse
(<string> sQuery, <object> oResponse, <object> oParent)
Parses raw response data into an array of result objects.
|
Methods inherited from class YAHOO.widget.DataSource
Field Detail [top]
connTimeout
number
connTimeout
Number of milliseconds the XHR connection will wait for a server response. A
a value of zero indicates the XHR connection will wait forever. Any value
greater than zero will use the Connection utility's Auto-Abort feature.
Default: 0.
ERROR_DATAXHR
constant
ERROR_DATAXHR
Error message for XHR failure.
responseStripAfter
string
responseStripAfter
String after which to strip results. If the results from the XHR are sent
back as HTML, the gzip HTML comment appears at the end of the data and should
be ignored. Default: "\n<!--"
responseType
type
responseType
XHR response data type. Other types that may be defined are TYPE_XML and
TYPE_FLAT. Default: TYPE_JSON.
schema
Object
schema
scriptQueryAppend
string
scriptQueryAppend
String of key/value pairs to append to requests made to scriptURI. Define
this string when you want to send additional query parameters to your script.
When defined, queries will be sent to
?=userinput&
Default: "".
scriptQueryParam
string
scriptQueryParam
Query string parameter name sent to scriptURI. For instance, queries will be
sent to
?=userinput
Default: "query".
scriptURI
string
scriptURI
Absolute or relative URI to script that returns query results. For instance,
queries will be sent to
?=userinput
TYPE_FLAT
constant
TYPE_FLAT
Flat file data type
TYPE_JSON
constant
TYPE_JSON
JSON data type
TYPE_XML
constant
TYPE_XML
XML data type
Constructor Detail [top]
YAHOO.widget.DS_XHR
YAHOO.widget.DS_XHR
()
Implementation of YAHOO.widget.DataSource using XML HTTP requests that return
query results.
requires YAHOO.util.Connect XMLHTTPRequest library
extends YAHOO.widget.DataSource
- Parameters:
-
sScriptURI
- Absolute or relative URI to script that returns query results as JSON, XML, or delimited flat data -
aSchema
- Data schema definition of results -
oConfigs
- Optional object literal of config params
Method Detail [top]
doQuery
void
doQuery
(<object> oCallbackFn, <string> sQuery, <object> oParent)
Queries the live data source defined by scriptURI for results. Results are
passed back to a callback function.
- Parameters:
-
oCallbackFn
- Callback function defined by oParent object to which to return results -
sQuery
- Query string -
oParent
- The object instance that has requested data
parseResponse
array
parseResponse
(<string> sQuery, <object> oResponse, <object> oParent)
Parses raw response data into an array of result objects. The result data key
is always stashed in the [0] element of each result object.
- Parameters:
-
sQuery
- Query string -
oResponse
- The raw response data to parse -
oParent
- The object instance that has requested data
- Returns:
- Array of result objects