On Saturday, June 16, 2018 at 10:03:37 AM UTC-4, Jim S wrote:
>
> Here is a sample we have where we add 'links'.
>
> links = [lambda row: A(XML('<span class="glyphicon glyphicon-pencil
> space-after"></span> Edit'),
> _href=URL('sample', 'sample', vars={'sample_id':
> row.sample.id}, user_signature=True),
> _class='btn btn-default'),
> lambda row: A(XML('<span class="glyphicon glyphicon-pencil
> space-after"></span> Reports'),
> _href=URL('sample', 'sample_reports',
> vars={'sample_id': row.sample.id},
> user_signature=True), _class='btn
> btn-default'),
> lambda row: A(XML('<span class="glyphicon glyphicon-paperclip
> space-after"></span> Attach Document'),
> _href=URL('sample', 'sample_attach_document',
> vars={'sample_id': row.sample.id},
> user_signature=True), _class='btn
> btn-default', _name='attach_document'),
> lambda row: A(XML('<span class="glyphicon glyphicon-eye-open
> space-after"></span> View Attached'),
> _onclick='open_modal(%s)' % row.sample.id, _class='btn
> btn-default') if row.sample_attachment.id else None
> ]
>
>
> It appears to me that your first 'link' is actually an extra column that
> you're adding to your grid.
>
> Then, the second dict shouldn't be a dict at all, links should just be a
> list of your lambdas, like you have in the 'body' of the second dict.
>
Note, links can include dictionaries -- any link that is a dict will be put
in its own column rather than being added as a button in a single "links"
column.
Anthony
--
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.