Hello!
I found this tricky way to have in evidence required fields in a grid
defined like the following:
<code>
def dressMandatory(grid, table):
""" Special representation for mandatory fields in grid """
for fieldname in table.fields:
myid = '_'.join((table._tablename, fieldname, ))
# icon = I(_class="icon-warning-sign")
app = '' # SPAN(icon, _class="add-on") if
table[fieldname].required else ''
class_value = "control-group warning" if
table[fieldname].required else ''
grid.elements('#%s' % myid, replace=lambda el:
DIV(DIV(TAG.nobr(el, app), _class="input-append"),
_class=class_value))grid =
mygrid = SQLFORM.smartgrid(db.mytable)
dressMandatory(mygrid, db.mytable)
</code>
Can you help to do the same with a form like that:
form = SQLFORM.factory(db.mytable)
Thank you in advance
Cheers
Manuele
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.