Overriding url construction for goog.ui.AutoComplete.RichRemote
32 views
Skip to first unread message
Paul Davis
unread,
Jan 4, 2011, 2:09:23 PM1/4/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to closure-lib...@googlegroups.com
I was having trouble finding out how to override the parameter names used in building the url.
I implemented this way (it works but, it just doesn't seem right):
var ac = new goog.ui.AutoComplete.RichRemote("http://www.myserver.com/typeahead.json", input); ac.matcher_.buildUrl = function(uri, token, maxMatches, useSimilar, opt_fullString) { var url = new goog.Uri(uri); url.setParameterValue('name', token); console.log(url.toString()); return url.toString(); };
Any advice?
xiaoxiao
unread,
Jan 19, 2011, 2:14:01 AM1/19/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Closure Library Discuss
It's better to create a subclass from goog.ui.AutoComplete.RichRemote
and override buildUrl by your own.