Forum: Ruby on Rails auto-complete without connecting to the server

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ca0b18ec9e11dc777b2b8084fe5d5f90?d=identicon&s=25 Sam Kong (ssk)
on 2008-11-05 18:03
Hi,

My client wants to type instead of select from a list.
But it's not just a free typing but typing the first few letters.
So basically, it's auto-complete function except that the list data is
already in the client as an array in JavaScript.

Is there any plugin for such a function?
If not, how would you implement it?

Thanks.

Sam
F47bebf5f4b10b709a59310027c8f977?d=identicon&s=25 Robert Zotter (Guest)
on 2008-11-05 18:26
(Received via mailing list)
Sam,
I am unaware of any plugins for this, maybe there is one someone.
Fortunately though It is trivial to implement with the Scriptaculous
library.

Basically the syntax is
new Autocompleter.Local(id_of_text_field, id_of_div_to_populate,
array_of_strings, options);

Take a look at the local autocompleter wiki, it has all the
information you will need.
http://github.com/madrobby/scriptaculous/wikis/aut...

Cheers

--
Robert Zotter
Zapient, LLC
Ruby on Rails Development and Consulting

http://www.zapient.com
http://www.fromjavatoruby.com
F47bebf5f4b10b709a59310027c8f977?d=identicon&s=25 Robert Zotter (Guest)
on 2008-11-05 18:27
(Received via mailing list)
Typo

...maybe there is one someone --> ...maybe there is one somewhere.
Ca0b18ec9e11dc777b2b8084fe5d5f90?d=identicon&s=25 Sam Kong (ssk)
on 2008-11-05 19:06
Robert Zotter wrote:

> Take a look at the local autocompleter wiki, it has all the
> information you will need.
> http://github.com/madrobby/scriptaculous/wikis/aut...


Thank you very much.
This is exactly what I was looking for.

Sam
This topic is locked and can not be replied to.