fixed issue 1761:Add <col> elements to the grid for easier column formatting, thanks Anthony

This commit is contained in:
mdipierro
2013-11-01 18:01:02 -05:00
parent 975bc64fd0
commit a01aa78f36
2 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.7.4-stable+timestamp.2013.11.01.17.44.38
Version 2.7.4-stable+timestamp.2013.11.01.18.00.16
+9 -1
View File
@@ -2411,7 +2411,9 @@ class SQLFORM(FORM):
limitby = None
if rows:
htmltable = TABLE(THEAD(head))
cols = [TAG.col(_id=str(c).replace('.','-'),data={'position':i})
for i,c in enumerate(columns)]
htmltable = TABLE(TAG.colgroup(*cols),THEAD(head))
tbody = TBODY()
numrec = 0
for row in rows:
@@ -2863,6 +2865,7 @@ class SQLTABLE(TABLE):
selectid=None,
renderstyle=False,
cid=None,
colgroup=False,
**attributes
):
@@ -2886,6 +2889,11 @@ class SQLTABLE(TABLE):
(t, f) = c.split('.')
field = sqlrows.db[t][f]
headers[c] = field.label
if colgroup:
cols = [TAG.col(_id=c.replace('.','-'),data={'position':i})
for i,c in enumerate(columns)]
components.append(TAG.colgroup(*cols))
if headers is None:
headers = {}
else: