adding html to SQLform.grid

70 views
Skip to first unread message

Yebach

unread,
Dec 24, 2014, 8:57:12 AM12/24/14
to web...@googlegroups.com
Hello

Is it possible to add html (<span>) to SQLFORM.grid. I have a color picker widget and it works ok but it colors the whole field. I would like to add a new html tag inside a table where color picker would be presentet. It is possible to do this inside web2py or do I have to write JS code.

Also in my view grid I would like to have a field where color would be presented. Again. Is it possible to add html inside web2py or is JS or JQuery code needed?

thank you

mcamel

unread,
Dec 24, 2014, 9:15:23 AM12/24/14
to web...@googlegroups.com
Hi,

You can do DOM parsing at web2y level with something like:

        grid = SQLFORM.grid(...)
        table
= grid.element("table") # or grid[1][0]
        table
.insert(0, TR(LABEL('label1:'), INPUT(_name='_myname', _type='text', ....)))

0 for the first, -1 for the last...


Regards.
Reply all
Reply to author
Forward
0 new messages