On Thursday 19 July 2007 05:35:43 Grzegorz Staniak wrote:
> Hello,
>
> >From what I've found in trhe docs and Trac, I guess that I can set
>
> a delay on the AutoComplete widget to make it start the lookup not
> immediately or after some time. But is it possible to set a limit
> of n characters which have to be entered into the field to trigger
> autocompletion? For a field that links to a heavily populated

In your callback function or on your controller check how many characters 
you're receiving and then impose your limit.

if len(received) < 4 then:
    return dict(matches=None)
matches = do_query(received)
return dict(matches=matches)

> table sending a suggestion after just one character has been
> entered (and the user paused typing to gather thoughts, thus
> defeating autocompletion time delay) is a waste of resources.
> I think it would be convenient to be able to say, e.g. "only start
> looking for suggestions after at least 3 characters have been
> entered into the field". What do you think, is it feasible?

When you have the source, everything is possible ;-)  But in this case it is 
just a normal check on what you got before you do anything.


-- 
Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to