The grid acts like a DIV().

So if form=SQLFORM.grid

Then form[0] is the shaded area with the search bar.
Likewise form[1] is the table with the data in it.

You could do form[1].append(whatever) or form[1].insert(-1, stuff).

form.process().accepted becomes form[1].process().accepted

If I recall correctly, form[1][0][1] is the table head row with the
column titles.
To confirm, you could do print form[1][0][1][0] right after the call
to grid in your controller.

On Dec 16, 2:25 am, whowhywhat <mads...@gmail.com> wrote:
> I could not find any post/documentation on how the create, edit and update
> forms generated by SQLFORM.grid could be customized. I am assuming that it
> is similar to CRUD form customization. However I have not been able to
> figure it out.
> For example if i wished to have a optional field exposed upon a condition
> (optional spouses name if person is married, as shown in some web2py
> examples), how could this be done in SQLFORM.grid ?
>
> thanks in advance :)
>
> p.s:
> web2py is shaping up beautifully .. hats off to Massimo, Antony and others
> ..
> I advocate web2py to any and everyone who is into web development.. thanks
> a lot!

Reply via email to