Since I have the values stored inside tables in a db, I am doing the 
queries I need and calculating values in the appropriate controllers and I 
am showing these values in the view like this:
total_cost["_extra"]["SUM(Call.Cost)"]

Otherwise, how can I do it in javascript on the client side?


quinta-feira, 25 de Junho de 2015 às 14:36:49 UTC+1, Leonel Câmara escreveu:
>
> You can also just use regular jquery ajax call instead of web2py's ajax 
> and put the new row on the table with jquery. Something like:
> $.get(
>      "{{=URL('default','calculate_cost')}}",
>      $('#myForm').serialize(),
>      function(newrow) {
>         $('#my_table tbody').append(newrow);
>      }
> );
>
>
> This assumes my_function is returning the HTML of the new row. You can 
> return json, use getJSON and make the HTML on the client.
>
> If you want to get fancy you can use ractive for this as it was really 
> made for this kind of stuff.
>
> On the other had why would you need to go to the web2py server to 
> calculate these values can't you do it client side in javascript?
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to