YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

DataSource Utility  2.8.1

Yahoo! UI Library > datasource > YAHOO.util.ScriptNodeDataSource

Class YAHOO.util.ScriptNodeDataSource - extends YAHOO.util.DataSourceBase

ScriptNodeDataSource class for accessing remote data via the YUI Get Utility.


YAHOO.util.ScriptNodeDataSource ( oLiveData , oConfigs )
oLiveData <HTMLElement> Pointer to live data.
oConfigs <object> (optional) Object literal of configuration values.


_nId - private static Number

Unique ID to track requests.

_nPending - private static Number

Counter for pending requests. When this is 0, it is safe to purge callbacks array.

asyncMode - String

Defines request/response management in the following manner:
Send all requests, but handle only the response for the most recently sent request.
Send all requests and handle all responses.
Default Value: "allowAll"

callbacks - static Function[]

Global array of callback functions, one for each request sent.

getUtility - Object

Alias to YUI Get Utility, to allow implementers to use a custom class.
Default Value: YAHOO.util.Get

scriptCallbackParam - String

Callback string parameter name sent to the remote script. By default, requests are sent to <URI>?<scriptCallbackParam>=callback
Default Value: "callback"



String doBeforeGetScriptNode ( URI )
Overridable method gives implementers access to modify the URI before the dynamic script node gets inserted. Implementers should take care not to return an invalid URI.
URI <String> to the script
Returns: String
URI to the script


String generateRequestCallback ( )
Creates a request callback that gets appended to the script URI. Implementers can customize this string to match their server's query syntax.
Returns: String
String fragment that gets appended to script URI that specifies the callback function


Number makeConnection ( oRequest , oCallback , oCaller )
Overriding method passes query to Get Utility. The returned response is then forwarded to the handleResponse function.
oRequest <Object> Request object.
oCallback <Object> Callback object literal.
oCaller <Object> (deprecated) Use oCallback.scope.
Returns: Number
Transaction ID.

Copyright © 2010 Yahoo! Inc. All rights reserved.