If of interest to anyone, eventually, I made my own autocomplete based on 
Bootstrap Typeahead:

def bs_typeahead(f, v, **kwargs):
    options = {'_data-provide':'textahead'}
    options.update(kwargs)
    return CAT(
        INPUT(_type="text", _class="string", _id="%s_%s_ac" % (f._tablename,f
.name), **options), 
        INPUT(_type="hidden", _id="%s_%s" % (f._tablename, f.name), _name=f.
name, _value=v, requires=f.requires),
        SCRIPT("$($('#%(table)s_%(field)s_ac').typeahead({minLength: 3, 
source:function(query,process){console.log(query); return 
$.get('%(url)s.json', {'_ac_%(table)s_%(field)s': query}, 
function(data){return process(data.options)})}, 
highlighter:function(item){return 
item.split('_')[1]},updater:function(item){ var p=item.split('_'); 
$('#%(table)s_%(field)s').val(p[0]); return p[1]}}))" % {'url':URL(), 
'table':f._tablename, 'field':f.name})
    )

and with the appropriate handler for request.vars['ac_%s_%s' 
%(f._tablename, f.name)]

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to