In my application called init I use the Pengoworks auto complete
plugin. In previous versions of the web2py_ajax.html file this worked,
in the current version of web2py_ajax.html it doesn't.
I made a copy of web2py_ajax.html and named it after my application
init_ajax_html, I also renamed the functions:
function web2py_ajax_init() {}
$(document).ready(web2py_ajax_init);
... they read like:
function init_ajax_init() {}
$(document).ready(init_ajax_init);
Within the init_ajax_init() I have the following line of code:
$('#clubbyplace').autocomplete('/init/handlers/clubbyplaceAC',
{maxItemsToShow:12});
... in the function in the controller I have:
form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY(),\
widget=lambda self, value:INPUT
(_type='text',_id='clubbyplace',_class='ac_input',_name='plaats',requires=self.requires)))
... and in the handler:
def clubbyplaceAC():
q=''
if request.vars:
q=request.vars.q
if not q:
return q
rows=db((db.adres.bedrijf==db.bedrijfinschrijving.bedrijf)&
(db.bedrijfinschrijving.inschrijving==2)&\
(db.adres.plaats.like('%s%%'%q.capitalize())))\
.select(db.adres.plaats,orderby=db.adres.plaats,distinct=True)
r=''
for row in rows:
r='%s%s\n'%(r,row.plaats)
return r
What do I have to do to get this to work as it did perviously?
Kind regards,
Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---