Created
August 27, 2009 19:08
-
-
Save web-zen/176482 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get list of users | |
| YAHOO.namespace("DDSuccess"); | |
| YAHOO.DDSuccess = { dd1:null, dd2:null }; | |
| var sUrl1 = 'db_taskmanager.php?action=select-users'; | |
| // Dropdown 1 | |
| var DD1handleSuccess = function(o){ | |
| test(); | |
| if(o.responseText !== undefined){ | |
| var json = YAHOO.lang.JSON.parse(o.responseText); | |
| // for (var i = 0, len = json.rows.length; i < len; ++i) { | |
| // alert(json.rows[i].label); | |
| // } | |
| } | |
| }; | |
| var DD1handleFailure = function(o){ | |
| YAHOO.DDSuccess.dd1 = false; | |
| //alert("failure"); | |
| }; | |
| var DD1callback = | |
| { | |
| success: DD1handleSuccess, | |
| failure: DD1handleFailure | |
| }; | |
| var request = YAHOO.util.Connect.asyncRequest('GET', sUrl1, DD1callback); | |
| // Dropdown 2 | |
| var sUrl2 = 'db_taskmanager.php?action=select-users'; | |
| var DD2handleSuccess = function(o){ | |
| test(); | |
| if(o.responseText !== undefined){ | |
| var json = YAHOO.lang.JSON.parse(o.responseText); | |
| // for (var i = 0, len = json.rows.length; i < len; ++i) { | |
| // alert(json.rows[i].label); | |
| // } | |
| } | |
| }; | |
| var DD2handleFailure = function(o){ | |
| YAHOO.DDSuccess.dd2 = false; | |
| //alert("failure"); | |
| }; | |
| var DD2callback = | |
| { | |
| success: DD2handleSuccess, | |
| failure: DD2handleFailure | |
| }; | |
| var request = YAHOO.util.Connect.asyncRequest('GET', sUrl2, DD2callback); | |
| function test(){ | |
| if (YAHOO.DDSuccess.dd1&&YAHOO.DDSuccess.dd2) | |
| renderDataTable(); | |
| } | |
| function renderDataTable(){ | |
| alert("success"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment