After reading the sqlhtml.py for a while last night. I decided to use the
same method.
Before creating the grid:
if request.args(-3) in ('edit', 'view'):
On Wednesday, 12 December 2018 00:10:02 UTC+1, Paul Ellis wrote:
>
> I have a grid with some links. One of the buttons is a placeholder which
> some Jquery attaches to (useless in a the subforms). How do I stop this
> button from appearing in the subforms Edit and View.
> I don't really want or need any of the links to appear in the subforms.
>
> grid = SQLFORM.grid(query,
> links = [
> lambda row: 'returns a button',
> lambda row: 'returns another button',
> ]
> )
>
> The only thing I can think of is something like this before the grid and
> the links = links in the grid:
> if 'view' in request.args:
> links = []
> else:
> links = [lambda, lambda, lambda]
> Is there something already in the SQLFORM.grid which can do this?
>
> ** The links do not appear in the Add form. Just in the Edit and View form.
>
>
--
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.