If wish to build such a feature, there is nothing specifically Pyramid about
doing so, although it can help.

What you are looking an is an autocomplete box. The components would be:

1. javascript which makes a call to the server with the values to be
completed and then fills in the box once the server responds
2. code on the server which sends back a list of values for the javascript
to use

The jquery library is popularly used for 1. (the 'Ajax' part). Have a look
at http://docs.jquery.com/Plugins/autocomplete

For 2., this is where you can use Pyramid. You will need a route on your
server which accepts the request from Jquery and then returns data in the
appropriate format. See:

http://stackoverflow.com/questions/6371276/simple-pyramid-ajax-jquery-questions

for a short summary/example. As mentioned there, you can use the xhr
parameter to your add_route to detect that the request came from Jquery if
you wish (see
https://docs.pylonsproject.org/projects/pyramid/1.0/api/config.html#pyramid.config.Configurator.add_route
).

If you want to use a form library, then Deform has a specific example of how
to do this (although you will still have to handle step 2):

http://deformdemo.repoze.org/autocomplete_remote_input/

Hope some of this helps,
Ben



On 12 September 2011 06:06, Edvinas Narbutas <enarbu...@gmail.com> wrote:

> How would you call a python function in pyramid for a 'Google type'
> search pop up box with Ajax or any other way? Ive searched for it but
> found no solution.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to