alexkuebo-VInPYn6yXxRWk0Htik3J/w@public.gmane.org
2007-Jan-17 10:01 UTC
Triggering Autocompleter by button
Hi!
I got a Autocompleter on my page and its working fine. For mouse-users
I need a button which triggers the Autocomplete. I tried a
this.getUpdatedChoices(); and it starts a request, but it doesn''t seem
to handle the response.
----------------------------------------------
Ajax.TriggerableAutocompleter = Class.create();
Object.extend(Object.extend(Ajax.TriggerableAutocompleter.prototype,
Ajax.Autocompleter.prototype), {
initialize: function(element, update, url, options) {
this.baseInitialize(element, update, options);
this.options.asynchronous = true;
this.options.onComplete = this.onComplete.bind(this);
this.options.defaultParams = this.options.parameters || null;
this.url = url;
this.cache = {};
if(this.options.trigger) {
Event.observe($(this.options.trigger), "click",
this.onTriggerClick.bindAsEventListener(this));
};
},
onTriggerClick: function() {
this.element.value = "%";
this.getUpdatedChoices();
},
});
------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
