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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to