Thanks Calvin! Exactly what I needed.

Is there be a way to hide it at the grid level, but let it be readable when
viewing the record detail? (I can do without it -- just curious really.)
best regards


On Mon, May 27, 2013 at 1:21 PM, Calvin <[email protected]> wrote:

> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/wKKlDWIuA3U/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
<http://alum.mit.edu/www/rcardenas> Ricardo Cárdenas<[email protected]>|
http://alum.mit.edu/www/rcardenas | Perú: (+51) 96176-3092 | USA: +1 650
395-7772 | México: +52 (155) 2691-9958

-- 

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


Reply via email to