[web2py] Re: Adding extra links to smartgird

2012-10-12 Thread Simon Carr
Do you mean like this: def uploadfile(): filelist = SQLFORM.smartgrid(db.productdatafiles,links=dict(table_a=[ lambda row: A('Duplicate', _class='button', _onclick='return confirm(Duplicate %s?)' %

Re: [web2py] Re: Adding extra links to smartgird

2012-10-12 Thread Simon Carr
OK Sorted it, Not sure why your example didn't work, but I took a very similar example from another web site and it worked fine. Thanks anyway for putting me on the write track. Simon On 12 October 2012 20:35, Simon Carr simonjc...@gmail.com wrote: Do you mean like this: def uploadfile():

Re: [web2py] Re: Adding extra links to smartgird

2012-10-12 Thread Simon Carr
Sorry, in case anyone else comes across this post looking for the same thing, here is the code I used to generate my smartgird. def uploadfile(): filelist = SQLFORM.smartgrid(db.productdatafiles,links = [lambda row: A(T('Process File'),_href=URL(vital,processfile,args=[row.id]))]) return

Re: [web2py] Re: Adding extra links to smartgird

2012-10-12 Thread Adnan Smajlovic
Hi Simon, It didn't work because I put there table_a, referring to a table where you need your button displayed. In your case, you could put there productdatafiles (without db in front). Since smartgrid drills into related tables, some buttons will not be applicable to those tables, like in my