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:
'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.