Re: [web2py] Re: Override _autocomplete function

2013-03-19 Thread Richard Vézina
Hi Richard It looks like you have got here faster than I did! Glad it worked out for you. Just some comments: Using the version I posted allows one to handle the AJAX callback directly within the function embedding the widget. Each function can handle the callback differently. One requirement tho

Re: [web2py] Re: Override _autocomplete function

2013-03-18 Thread Richard Vézina
Here what I come up with : def autocomplete_typeahead_widget(f, v, **kwargs): table_name = f._tablename field_name = f.name field_requires = f.requires field_value = v options = {'_data-provide':'typeahead', '_autocomplete': 'off'} options.update(kwargs) return CAT(

Re: [web2py] Re: Override _autocomplete function

2013-03-18 Thread Richard Vézina
Hello Calvin, This seems interesting. I was planning to work un this when I get time but it looks that what you did is a good start! I have a question, I am not sure how you was thinking to initialize the widget on a select type field?? Should I do something like this in order to use your typeah

[web2py] Re: Override _autocomplete function

2013-03-11 Thread Calvin
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 .na