For example:
db.define_table('thing',Field('name'),Field('checked','boolean',readable=False)) def index(): grid = SQLFORM.grid(db.thing, links=[lambda row: A('check',_onclick="jQuery.post('%s')" % URL('check',args=row.id))]) return dict(grid=grid) def check(): db(db.thing.id==request.args(0)).update(checked=True) On Monday, 20 March 2017 18:38:52 UTC-5, 黄祥 wrote: > > could anyone give an example to custom button in grid that does an ajax > query? > > another question is oot : > what is the best practice to define table for transaction that separated > for header and detail? > when use header and detail it good for normalisation but not good in > operational, in case want to edit or delete it, when using 1 table for > header and detail, the data is for header is repeated in the rows. > > thanks and best regards, > stifan > -- 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 the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.