A while back Anthony helped me solve a similar problem.
I have a jqueryui controller with the sources:
def locality_autocomplete():
rows=db(db.Locality.name.like(request.vars.term+'%'))\
.select(db.Locality.name,distinct=True,orderby=db.Locality.name).as_list()
result=[r['name']for r in rows]
return response.json(result)
and in the views that need the source:
<script type="text/javascript">
$(document).ready(function(){
$(function() {
$("#no_table_locality").autocomplete({
source: "{{=URL('jqueryui', 'addresslocality_autocomplete')}}",
minLength: 2
});
});
});
</script>
In my case $(document).ready(function() wasn't called in case of a nested
view in combination with the LOAD functionality. I had to move the script
to the nested view to solve the problem.
Regards,
Annet