Accessing values from additional field in sqlform.grid for all rows- Help Needed

25 views
Skip to first unread message

PremKumar KrishnaKumar

unread,
Jun 25, 2013, 10:45:26 PM6/25/13
to web...@googlegroups.com
Hi,
  

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

Why links why not selectable?

      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.

why both selected and not selected?

       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"





Reply all
Reply to author
Forward
0 new messages