I have been working with the Ajax.Autocompleter for about a day so forgive my ignorance. Is there any value in adding additional callbacks. I want perform an action when the user selects a choice. So I was thinking of adding an option {select: function(selectedElement) {}} similar to the callbacks on Ajax.Request in the prototype library. Call me out if you think I am crazy my feelings won''t get hurt. After looking at the code I guess I would probably add it to the Autocompleter.Base. Nicholas
You''re not crazy. This has been proposed before, and I welcome a patch. If you do implement one, call the callback "onSelect". I''m just wondering if it should fire before or after the selection is inserted into the text field....? Thomas Am 17.08.2005 um 13:52 schrieb Nic Schlueter:> I have been working with the Ajax.Autocompleter for about a day so > forgive my ignorance. Is there any value in adding additional > callbacks. I want perform an action when the user selects a choice. > So I was thinking of adding an option {select: > function(selectedElement) {}} similar to the callbacks on Ajax.Request > in the prototype library. Call me out if you think I am crazy my > feelings won''t get hurt. After looking at the code I guess I would > probably add it to the Autocompleter.Base. > > Nicholas > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
hehe, I just found this in the wish list on s.a.u Callbacks for Autocomplete: onSelect, gets called when someone clicks an option in the autocomplete, or, onBlur''s out of the field. Used when you have another, dependent, function to run. For example, populating another array for a second autocomplete. I would say after then you could manipulate the field or get the value out of the field and do something with it. Would you want me to implement both of these things while I am at it? How do I submit a patch? I will probably work on this after work tonight. Nicholas On 8/17/05, Thomas Fuchs <thomas@fesch.at> wrote:> You''re not crazy. This has been proposed before, and I welcome a patch. > If you do implement one, call the callback "onSelect". I''m just > wondering if > it should fire before or after the selection is inserted into the > text field....? > > Thomas > > Am 17.08.2005 um 13:52 schrieb Nic Schlueter: > > > I have been working with the Ajax.Autocompleter for about a day so > > forgive my ignorance. Is there any value in adding additional > > callbacks. I want perform an action when the user selects a choice. > > So I was thinking of adding an option {select: > > function(selectedElement) {}} similar to the callbacks on Ajax.Request > > in the prototype library. Call me out if you think I am crazy my > > feelings won''t get hurt. After looking at the code I guess I would > > probably add it to the Autocompleter.Base. > > > > Nicholas > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > >
Please do. :) I''ve added a page to the wiki describing how this should be done: http://wiki.script.aculo.us/scriptaculous/show/SubmittingPatches thomas Am 17.08.2005 um 14:22 schrieb Nic Schlueter:> Would you want me to > implement both of these things while I am at it? How do I submit a > patch? > > I will probably work on this after work tonight. > > Nicholas