fixed issue 1761:Add <col> elements to the grid for easier column formatting, thanks Anthony
This commit is contained in:
@@ -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
@@ -2411,7 +2411,9 @@ class SQLFORM(FORM):
|
|||||||
limitby = None
|
limitby = None
|
||||||
|
|
||||||
if rows:
|
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()
|
tbody = TBODY()
|
||||||
numrec = 0
|
numrec = 0
|
||||||
for row in rows:
|
for row in rows:
|
||||||
@@ -2863,6 +2865,7 @@ class SQLTABLE(TABLE):
|
|||||||
selectid=None,
|
selectid=None,
|
||||||
renderstyle=False,
|
renderstyle=False,
|
||||||
cid=None,
|
cid=None,
|
||||||
|
colgroup=False,
|
||||||
**attributes
|
**attributes
|
||||||
):
|
):
|
||||||
|
|
||||||
@@ -2886,6 +2889,11 @@ class SQLTABLE(TABLE):
|
|||||||
(t, f) = c.split('.')
|
(t, f) = c.split('.')
|
||||||
field = sqlrows.db[t][f]
|
field = sqlrows.db[t][f]
|
||||||
headers[c] = field.label
|
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:
|
if headers is None:
|
||||||
headers = {}
|
headers = {}
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user