I am using SQL.smartgrid to show a table and edit individual records by
pressing the edit button on each row.
works great.
Records have many fields( about 25) not all relevant to the daily editing,
so I want to show 'Edit advance' link/button in addition to the standard
'Edit' button
shown by the grid ( when editable is True). I tried to do something like(
adding 'advance' to args):
links = [lambda row: A(SPAN(_class='icon pen icon-pencil glyphicon
glyphicon-pencil') + T('Edit advance')
, _href=URL('shop','customer_list'
,args=['customer', 'edit', 'customer',
row.id,'advance']
, user_signature=True)
, _class='btn btn-default') or '']
Pressing this button supposedly will show the editing form and in the same
time will let me detect that the 'call' is actually from the 'Edit
advance' button and not the standard Edit button so I can set the
writable/readable properties of the extra fields just before the
SQL.smartgrid is called by doing something like:
if 'edit' in request.args:
if 'advance' in request.args:
show_advance_fields(True)# my function to make fields visible/unvisible
else:
show_advance_fields(False)# my function to make fields visible/unvisible
grid = SQLFORM.smartgrid(db.customer.....
However, instead it just display the grid again (without the 'Edit
Advancea' link) and not the edit form.
What is the best way to do that ?
Thanks
(SQL.smartgrid is an amazing component and a blessing to a none graphic
oriented individuals. It deserves a dedicated book /chapter)
--
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.