How can I access the web2py object passed to the view with Javascript.
For example, I am trying to use jquery to retrieve some additional data for
the current record being edited.
When i try and invoke the jquery call passing the id of the edited record,
i.e. results.update_form.custom.dspval.id I am unable to reference it in
javascript, but can using the templaye language (i.e. {{print
results.update_form.custom.dspval.id}}.
Here is the jquery call:
$().ready(function(){
console.log('----------- all is loaded ' + Date());
console.log('+++++++++++++++++++++++++++');
if (results.update_form.custom.dspval.id != null){
jQuery.getJSON("{{=URL("get_days",args=[results.update_form.custom.dspval.id])}}",
function(msg){
console.log('got some data')
console.log(msg);
})
}
I am useing firebug and tried to inspect the dom to find but am unable to
do so.
Any help would be appreciated as I bang my head against the wall trying to
figure out this front end development.
--
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.