before the call to SQLFORM.smartgrid, add
db.tablename.linkfield.readable=False
On Monday, 27 May 2013 23:57:31 UTC+8, Ricardo Cárdenas wrote:
>
> Hi,
>
> My model contains a URL field, and I'm displaying the model in a
> SQLFORM.smartgrid. I don't want to show the whole URL, but I do want the
> user to be able to visit the URL directly from the grid. So I use the
> 'links' parameter to SQLFORM.smartgrid. It works very nicely:
>
> links=[dict(header="Link", body=lambda row: A("Go",
> _href=row.linkfield,_target
> ="_blank"))]
>
>
> But it doesn't work if I remove 'linkfield' from the 'fields' parameter to
> SQLFORM.smartgrid. That's because, according to the
> documentation<http://web2py.com/books/default/chapter/29/07#SQLFORM.grid-and-SQLFORM.smartgrid>
> :
>
> *'fields' is a list of fields to be fetched from the database. It is also
>> used to determine which fields to be shown in the grid view.*
>
>
> In my use case, I want the field to be fetched, but not shown. Is there a
> "smart" (pun intended :) way to do this?
>
> best regards -Ricardo
>
> ps. I'd prefer not to mess around with jquery, and anyway it seems the
> <th> does not have a CSS class or id that would allow me to hide an
> undesired column.
>
--
---
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.