Created
November 23, 2010 23:09
-
-
Save meeech/712733 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
// Create new YUI instance, and populate it with the required modules | |
YUI().use('autocomplete', function(Y) { | |
//Begin Closure | |
//Used to parse out the JSONP reponse from the server. | |
YUI.namespace('Vault.ac').parseResponse = function(results) { | |
return results; | |
}; | |
if(Y.one('#q')) { | |
var autoComplete = new Y.AutoComplete({ | |
source : 'http://localhost/vault/entries/find?phrase={query}&callback=YUI.Vault.ac.parseResponse', | |
inputNode: '#q', | |
resultListLocator: function() { | |
console.log(arguments); | |
return 'bbb'; | |
}, | |
resultTextLocator: function() { | |
console.log(arguments); | |
return 'aaaaaa'; | |
} | |
}); | |
autoComplete.render(); | |
} | |
//End closure | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment