Hello!
I'm trying update a field (total_treated) with ajax. I'm using a
SQLFORM.grid.
In the index.html:
{{extend 'masterpage.html'}}
<script type="text/javascript">
$(document).ready(function(){
window.setInterval(function() {
var objs = $("[name^='t_']");
for(var i = 0; i < objs.length; i++)
{
var l = objs[i].getAttribute("id");
ajax('total_treated?l=' + l, ['id'], l);
# doesn't work:
# ajax('{{URL('total_treated')}}', ['id'], 'id');
}
}, 10000);
});
</script>
In the lists.py:
@auth.requires_login()
def total_treated():
print request.vars
ERROR:
...
File "/opt/web-apps/web2py/gluon/globals.py", line 218, in parse_post_vars
if len(dpost):
File "/usr/local/lib/python2.7/cgi.py", line 599, in __len__
return len(self.keys())
File "/usr/local/lib/python2.7/cgi.py", line 582, in keys
raise TypeError, "not indexable"
TypeError: not indexable
I tried a lot of things... but without success...
Help, please...
Thanks!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.