I am new to Web2Py and would like to achieve 'selectable' like functionality through links but I am not sure how to pass the ID and flag from checkbox to the controller function
I might need multiple columns with checkbox and links is the easiest way to achieve it. Also to the controller I wanted to pass both the selected and not selected ids and their flags.
For the corresponding ids I would like to update the flag in database to 1 or 0 depending on whether its checked or not.
Code?
testlink=[dict(header="Actioned",body=lambda row: INPUT(_name='actioned',_type="checkbox",_value=id))]
grid = SQLFORM.grid(query
,editable=True
,details=True
,deletable=True
,create=True
,links=testlink
,links_placement='left'
,showbuttontext=True
,fields=FIELDS
)
grid = FORM(grid,INPUT(_type="submit",_name="testsubmit",_value="testsubmit"))
if grid.process().accepted:
print "submit successful"