Matthew:

Look at the example in the attached file

Regards




El jueves, 24 de mayo de 2018, 10:46:05 (UTC-3), Matthew J Watts escribió:
>
> Hi all
>
> How do i  send args via a button from views. 
>
> For example, i'd like to send variables to the 'my_collections URL'  {{=A(
> 'Finish',_href=URL('my_collections'),_class="btn btn-primary")}}
>
> I can do something similar from the grid in a controller, however i cant 
> find the right way to it from a button in views
>
> links = [lambda row: A('Select', _class="btn 
> btn-primary",_href=URL('my_collections'),
>                                                                      
> vars={'collection_info_id': collection_info_id}))]
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
def displaydata():
    lid_data =  int(request.vars['id_data'])
    ....
    ....


def updatefamiliar(row,otherparameter):
    li_id = row.id
    li_tipodoc   = row.tipodoc
    if li_tipodoc < 4 and otherparameter:
        btn = A(I(_class='glyphicon glyphicon-retweet',_alt='MyData'),
                    _title='Data',
                    _href=URL('default', 
'displaydata',vars={'id_data':li_tipodoc}),
                    _class='button btn btn-default')
    return btn



def my_grid():
    ...
    ...
    grid=SQLFORM.grid(query,field_id = my.id,...,  links=[lambda r: 
showdata(r,otherparameter)])
    ...
    ...
   return locals()

Reply via email to