You need to pass a form to the modal... Do you want to embed create, read and update form into modal?
If so, I am not sure if that SQLFORM.grid is the best option or if there is a short cut... But basically to embed something in modal, you need a form... The way to get your form is to use web2py component. You can do that with LOAD command in your view then you just need to wrap those component into modal bootstrap code... And bind a trigger to a botton to make the modal appears... I try to use modal last week or the one before, I am not sure why, but the form tag of the form was clipped away so when I was submitting the form embedded into modal it was submitting all the form included into the page... Didn't investigate (don't have time)... Richard On Thu, Nov 15, 2012 at 2:16 PM, Teddy Nyambe <[email protected]>wrote: > Thanx, it was as you pointed out. But how can I correctly use the modal > window. It's working but the code is quiet dirty. > On Nov 15, 2012 9:03 PM, "Richard Vézina" <[email protected]> > wrote: > >> I am not pretty experienced with SQLFORM.grid, but the way you use >> bootstrap modal seems wrong... >> >> About the id problem, I notice that one time use row.id and the other >> row.office.id maybe your problem come from there?! >> >> Richard >> >> On Thu, Nov 15, 2012 at 12:58 AM, Teddy Nyambe <[email protected]>wrote: >> >>> Hi, >>> >>> I have the following action in the controller, doing a join to display >>> "office name" and a reference to department of "department name" to >>> which office belongs...but i have an error in the link since I have a >>> modal window am opening to edit/add/delete details...this is the >>> error: >>> >>> <type 'exceptions.AttributeError'> 'Row' object has no attribute 'id' >>> >>> >>> def office(): >>> db.office.id.readable = False >>> query = ((db.office.department == db.department.id)) >>> #((db.contact.date_of_birth < “1990-11-18”)) >>> fields = (db.office.name, db.department.name) >>> link = [lambda row: A('Edit', _class='btn', _role='button', >>> _onclick='dept_edit('+str(row.office.id >>> )+');',**{'_data-toggle':'modal'}) >>> ,lambda row: A('Delete', _class='btn', _role='button', >>> _onclick='dept_delete('+str(row.id)+');',**{'_data-toggle':'modal'})] >>> headers = {'db.office.name': 'Office Name','db.department.name': >>> 'Department'} >>> default_sort_order=[db.office.name] >>> >>> form = SQLFORM.grid(query=query, headers=headers, >>> orderby=default_sort_order ,links=link, create=False, deletable=True, >>> editable=False, maxtextlength=64, paginate=25) >>> return dict(form=form) >>> >>> How do I pass an id of a row in lambda for the link parameter of the >>> SQLFORM.grid. >>> >>> Been stuck with this error for a day now!! >>> >>> Kind regards, >>> >>> Teddy L. >>> >>> -- >>> >>> >>> >>> >> -- >> >> >> >> > -- > > > > --

