On Thursday, June 1, 2017 at 2:52:08 PM UTC-7, icodk wrote: > > Thanks, That explain why it didn't work in smartgrid (because I haven't > specify the table name) > I still do not understand how my arguments will effect the auto generated > SQLFORM or what kind of argument will effect the form and in what way. > Is Niphlod's example is the only thing you can do with it (reorder > fields)? > Thanks >
Perhaps you could add a link to Niphlod's post, so that we can see what context he was addressing. /dps > > On Thursday, June 1, 2017 at 7:06:13 PM UTC+2, Anthony wrote: >> >> On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote: >>> >>> Antony >>> could you elaborate or give an example of how to use formargs,editargs >>> etc. ? >>> >> >> When viewing/creating/updating individual records, the grid creates a >> SQLFORM. You can use formargs, etc. to pass arguments directly to the >> SQLFORM instance generated by the grid -- just put the relevant arguments >> in a dictionary. >> >> >>> You write that it can be used by passing it to SQLFORM but what could be >>> the actual use of it? >>> In another post >>> >>> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J >>> >>> Niphlod get a bit closer to a use example by specifying editargs to >>> reorder fields on an edit form. For the first it works on grid but not on >>> smartgrid, why ? >>> >> >> The smartgrid can display forms for multiple tables, so many of its >> arguments should actually be dictionaries with individual table names as >> the keys, and then the arguments for each table as the values. So, for >> smartgrid, you would have something like: >> >> SQLFORM.smartgrid(..., formargs={'table1': dict(...), 'table2': dict >> (...), ...}) >> >> Anthony >> > -- 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.