Skip to content

Instantly share code, notes, and snippets.

@web-zen
Created August 21, 2009 13:32
Show Gist options
  • Select an option

  • Save web-zen/171995 to your computer and use it in GitHub Desktop.

Select an option

Save web-zen/171995 to your computer and use it in GitHub Desktop.
http://techdocs.local/db_taskmanager.php?action=select-usersDataSource%20instance0
var handleSuccess = function(o){
alert("success");
};
var handleFailure = function(o){
alert("failure");
};
var DDcallback =
{
success:handleSuccess,
failure: handleFailure
};
// Get list of users
var myUsersDataSource = new YAHOO.util.XHRDataSource('db_taskmanager.php?action=select-users'); // instantiate XHRDataSource for Ajax
myUsersDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON; // expect to parse JSON data
myUsersDataSource.responseSchema = {resultsList: "usersList", fields: ["value", "label"]}; // columns to pass into a datatable object
// Define Editors for DataTable
var myEditor = new YAHOO.widget.TextboxCellEditor({disableBtns:false, asyncSubmitter: updateRecord});
var myDDEditor = new YAHOO.widget.DropdownCellEditor({dropdownOptions:myUsersDataSource,disableBtns:true, asyncSubmitter: updateRecord});
myUsersDataSource.sendRequest(myUsersDataSource, DDcallback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment