try replace

Field.Virtual('anexos', lambda row: "<a href=''>Teste_%s</a>" % row.parte.id
)

with

Field.Virtual('anexos', lambda row: XML("<a href=''>Teste_%s</a>" % row.
parte.id))
or
Field.Virtual('anexos', lambda row: A('Teste_%s'" % row.parte.id,_href=''))


but you may also want to consider using this instead:

db.parte.id.label = "anexos"
db.parte.id.represent =  lambda id,row: lambda row: A('Teste_%s'" % id
,_href=''))

On Friday, 27 December 2013 12:23:08 UTC-6, Diego Tostes wrote:
>
> Hi,
>
> I am trying to create a virtualfield as a link like the this code:
>
> http://pastebin.com/c2wZqECH
>
> But when i create a SQL.grid this virtualfield is displayed as a string.
>
> Is it possible to create a link ?
>
> Rgds,
>
> Diego
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to