Skip to content

Instantly share code, notes, and snippets.

@web-zen
Created August 20, 2009 18:04
Show Gist options
  • Save web-zen/171234 to your computer and use it in GitHub Desktop.
Save web-zen/171234 to your computer and use it in GitHub Desktop.
// setup callback
var handleSuccess = function(o){
datasource.sendRequest();
}
var handleFailure = function(o){
}
var DDcallback =
{
success:handleSuccess,
failure: handleFailure,
};
// instantiates myUsersDataSource
var myUsersDataSource = new YAHOO.util.XHRDataSource('db_taskmanager.php?action=select-users');
// tells it what data will be returning
myUsersDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
// sets up the schema for what data gets parsed for use
myUsersDataSource.responseSchema = {resultsList: "usersList", fields: ["value", "label"]};
myDDEditor.subscribe("showEvent", DDcallback) // listen for the dropdown to be clicked
// Define Editor for Dropdown
var myDDEditor = new YAHOO.widget.DropdownCellEditor({dropdownOptions:myUsersDataSource,disableBtns:true, asyncSubmitter: updateRecord});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment