Re: [web2py] Multiple buttons in links of smartgrid

2013-09-28 Thread 黄祥
> it's not a matter on "you must do it" but a matter of "you should do it": > indentation keeps the code more readable and it will be easier for you to > spot bugs. Once the code works you can either decide to squash everything > in the minimum number of lines possible or to keep it fully inde

Re: [web2py] Multiple buttons in links of smartgrid

2013-09-28 Thread Niphlod
On Saturday, September 28, 2013 3:59:34 PM UTC+2, 黄祥 wrote: > > thank you so much for your detail explaination. i'm sorry, my fault for > indentation, because to make it simple and straight to the point, i take > the code from the conditional, then remove the indentation (tab). > it works well

Re: [web2py] Multiple buttons in links of smartgrid

2013-09-28 Thread 黄祥
thank you so much for your detail explaination. i'm sorry, my fault for indentation, because to make it simple and straight to the point, i take the code from the conditional, then remove the indentation (tab). it works well now. e.g. if request.args(-3) == 'invoice_header' and request.args(-2

Re: [web2py] Multiple buttons in links of smartgrid

2013-09-28 Thread Niphlod
start small, then extend (and don't forget to use indentation to see where your errors are): it's not the first time you incur in errors not passing the expected data type for an argument. links is a list of dicts. any dict should contain a header that is what the column should be called and a

Re: [web2py] Multiple buttons in links of smartgrid

2013-09-27 Thread 黄祥
how to add the header for multiple buttons? i mean 1 header field that have multiple buttons on the body. when i try it return an error : TypeError: 'list' object is not callable my code : invoice_links=[dict(header=T('Print'), body=[lambda row: A(I(_class='icon-print'), _title=T("Print Invoi

Re: [web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Paolo Caruccio
"links" is a list so you could add more items to it. links = [lambda row: A(T('action 1'),_href=URL("acontroller ","function1",args=[row.id])), lambda row: A(T('action 2'),_href=URL("acontroller ","function2",args=[row.id, row.field1])), lambda row: A(T('action 3'),_href=URL("acontro

Re: [web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Cornelius Kölbel
Am 07.06.2012 12:46, schrieb Johann Spies: > On 7 June 2012 11:01, Cornelius Kölbel > wrote: > > Hi, > is it possible to add more than one button to a SQLFORM.smartgrid? > > Yes. > > > At the moment I would add one button like this...| >

Re: [web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Johann Spies
On 7 June 2012 11:01, Cornelius Kölbel wrote: > Hi, > is it possible to add more than one button to a SQLFORM.smartgrid? > > Yes. > At the moment I would add one button like this... > links = [lambda row: A(T('Add a contact to this > customer'),_href=URL("customer","add_contact",args=[row.i

[web2py] Multiple buttons in links of smartgrid

2012-06-07 Thread Cornelius Kölbel
Hi, is it possible to add more than one button to a SQLFORM.smartgrid? At the moment I would add one button like this...| links = [lambda row: A(T('Add a contact to this customer'),_href=URL("customer","add_contact",args=[row.id]))] |Thanks a lot and kind regards CorneliusKölbel signature.a