def documents():
response.title = 'Employee Documents '
get_default_company_id() or redirect(URL('company', 'companies'))
grid = SQLFORM.smartgrid(db.employee, deletable=False, linked_tables=['employee_document'], csv=False,
orderby=dict(employee=db.employee.last_name,
employee_document=db.employee_document.document_type),
onvalidation=dict(employee=on_validate, employee_document=on_validate_doc),
showbuttontext=dict(employee=False, employee_document=False)
)
return dict(grid=grid)
but this results in an error
<type 'exceptions.RuntimeError'> Invalid key in onvalidate dict
If I remove the onvalidation part from the above code, it runs fine.So my question again is, how do I pass a function to be called for onvalidation for a child grid created from a smartgrid? Thanks
for key in 'columns,orderby,searchable,sortable,paginate,deletable,editable,details,selectable,create,fields'.split(','):Ah OK great. I'll have to raise a github request then.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/WG28up_5YCs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.