There is a simple way :-)

from the code:

https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L2914

links(dict): like `{'tablename':[lambda row: A(....), ...]}`

that will add buttons when table tablename is displayed

On Thu, Mar 31, 2016 at 12:18 PM, Massimiliano <mbelle...@gmail.com> wrote:

> Sorry is a little more complex to get the table name involved.
>
> It should be in request.args(1)
>
> table = request.args(1).rpartition('.')[0]
>
> On Thu, Mar 31, 2016 at 12:10 PM, Massimiliano <mbelle...@gmail.com>
> wrote:
>
>> Maybe you can check the table involved and set links option accordingly.
>>
>> Something like:
>>
>> table = request.args(0) or ‘dashboard’
>>
>> links = []
>> if table == ‘label_dashboard’:
>>     links=[…]
>> grid = SQLFORM.smartgrid(db.dashboard,linked_tables=[‘label_dashboard’],
>> links=links)
>>
>>
>> Not tested
>>
>>
>> On Wed, Mar 30, 2016 at 6:40 PM, Alessio Varalta <
>> alessio.vara...@ethicalsoftware.it> wrote:
>>
>>> Hi I have a smartgrid with one child and i want a to add links to my
>>> child is possibile for example:
>>>
>>> I have entity dashboard with a child label_dashboard
>>>
>>> So i create the smartgrid
>>>
>>>     grid = SQLFORM.smartgrid(db.dashboard,linked_tables=['label_dashboard'])
>>>
>>> Now I want to add links to label_dashboard is possible? When in the grid
>>> i go to label_dashboard i want for every row a link button for go to a
>>> page..I know how use the link button in a grid but for the smartgrid?
>>>
>>> --
>>> 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/d/optout.
>>>
>>
>>
>>
>> --
>> Massimiliano
>>
>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 
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/d/optout.

Reply via email to