yes, you're right niphlod, i'm realize it right now, thank you so much.
thank you for your guide, anthony, yet, the value is not updated. no errors
occured, but when i tried to hit the button add , the value is still same
even after i refresh it. i'm not sure why it's not responding what i've
expected. any hints or conclusion about this?
many thanks in advance
i've updated my code into :
*controller : default.py*
def order_callback():
id=int(request.vars.id)
if request.vars.action=='add':
* "jQuery('item_%s' % p.id).session.order[id]=session.order.get(id,
0)+1;"*
"jQuery('total_%s' % p.id).session.order[id]=session.order.get(id,
0)+1;"
return str(session.order[id])
*view : order.html*
<table width="100%">
{{for id, qty in order.items():}}
{{p=db.product(id)}}
<tr>
<td>{{=SPAN(p.product_name)}}</td>
<td>{{=SPAN('Rp. %s' % p.unit_price)}}</td>
<td>{{=SPAN(qty, _id='item_%s' % p.id)}}</td>
<td>{{=SPAN(qty*p.unit_price, _id='total_%s' % p.id)}}</td>
* <td>{{=SPAN(A('Add', callback=URL('order_callback',
vars=dict(id=p.id, action='add')), target=':eval', _title='Add Quantity',
_class='btn btn-navbar'))}}</td>*
</tr>
{{pass}}
</table>
--
---
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.