Hi,
On 28/02/13 05:54, 黄祥 wrote:
i've tried to learn ajax callback using form(), but it's not work (no
error occured), did anyone know the solution for this?
thank you very much before
I'm having a little trouble understanding what you are doing here - I
would definitely use the tools that web2py offers rather than trying to
bypass them.
In this case you could use a component as described here: -
http://web2py.com/books/default/chapter/29/12#Components
Having said that, in your view you have: -
*#view*
*testing 1** not work no error occured:*
{{for i,row in enumerate(rows):}}
{{if i==items_per_page: break}}
<tr>
<td>{{=SPAN(row.product_name)}}
</td>
<td>{{=SPAN(session.order.get(row.id,0),
_id="item%s"%row.id), T(' In Order')}}
</td>
<td>{{=form}}
</td>
...a form per table row and...
* <td>{{=A('Order Now!!!', callback=URL('order_callback',
vars=dict(id=row.id, quantity=request.vars.quantity, action='add')),
target='item%s'%row.id, _title='Add the Order', _class='btn btn-navbar')}}*
* </td>*
...your button outside the form - is that intentional?
Web2py provides some very nifty tools for taking the hard work out of
this - can you help us understand why you don't want to use them?
Your question puts me in mind of the old joke: "If I was going there, I
wouldn't start from here". Perhaps we could be of more help to you if
you asked us how we would accomplish these tasks, so that we can suggest
a web2py-ish approach.
--
Regards,
PhilK
'a bell is a cup...until it is struck'
--
---
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.