hi,
is it possible grid selectable only select 1 row?
i've tested it but with no luck, e.g.
*controllers/order.py*
def sale_order_detail():
selectable = lambda ids : redirect(URL('sale_order_detail_checkout', vars =
dict(ids = ids) ) )
#selectable = lambda ids: sale_order_detail_checkout(ids)
grid = SQLFORM.grid(db.sale_order_detail, user_signature = False,
selectable = selectable)
return locals()
# sale_order_detail_checkout
def sale_order_detail_checkout():
ids = request.vars.ids
return dict(ids = ids)
*views/order/sale_order_detail_checkout.html*
{{extend 'layout.html'}}
{{=SPAN(ids)}}
<table class="table table-condensed table-hover">
<tr>
<th>{{=T('Product') }}</th>
<th>{{=T('ID') }}</th>
</tr>
{{for id in ids:}}
{{detail = db(db.sale_order_detail.id == id).select().first()}}
<tr>
<td>{{=SPAN(detail.product.model.model)}}</td>
<td>{{=SPAN(id)}}</td>
</tr>
{{pass}}
</table>
*Result*
No Error Occured, but the result is not expected. e.g. if i select multiple
row it works fine, but when i select only one row (id : 98), the result
show the content of id : 9 and id : 8
any idea how to solve this?
thanks and best regards,
--
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/d/optout.