>-----Message d'origine-----
>De : Alex Povolotsky [mailto:[email protected]] 
>Envoyé : samedi, 20. mars 2010 14:30

>Can anyont point me at
>
>- interoperability with C::P::P and current Prototype
>- maybe other Catalyst JS plugins?
>
>I'm mostly interested in COMPLEX autocompletion right now.
>
>BTW, maybe someone can clue me with my current task
>
>I have a large (10000+) database of people, and many-to-many 
>relationship people-request, so I should write some form to add people 
>to request.
>
>Loading all database into selectbox is not suitable for 
>obvious reason. 
>I'd like to write an Ajax-based autocompletion with "add to 
>list" button 
>enabled only when selection is fully done.

Hi Alex,

If you need sophisticated autocompletion, have a look at 
http://cpansearch.perl.org/src/DAMI/Alien-GvaScript-1.21/doc/html/Intro.html
http://cpansearch.perl.org/src/DAMI/Alien-GvaScript-1.21/doc/html/AutoCompleter.html


There is no Catalyst plugin but it's quite simple to integrate it into a 
Catalyst app :

a) write a Controller that will receive the Ajax requests and answer with a 
JSON datastructure (arrayref of possible values, or, if you want more complex 
behaviour on the client-side, arrayref of hashrefs with several fields for each 
returned entry).
b) serve the GvaScript.js file through Static::Simple or directly through your 
HTTP server
c) in your HTML page, include the GvaScript.js and write the JS code for 
initialising the Autocompleter object, giving it the URL for the Ajax 
controller and setting the appropriate options, as described in the doc. You 
can specify delays, case sensitivity, strictness, typeahead features, dependent 
fields, and many other options. 

If you need an example, install the Pod::POM::Web local documentation server 
and see how it works; it uses the autocompleter for perl functions and perl 
variables.

Good luck, Laurent Dami

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to