Added to Trac as #399
Am 15.01.2006 um 18:21 schrieb Martina Oefelein:
This patch adds the Grid (and DataGrid) to the widget browser:
Index: /Users/martina/Projekte/TurboGears/turbogears/widgets/
__init__.py
===================================================================
--- /Users/martina/Projekte/TurboGears/turbogears/widgets/
__init__.py (revision 516)
+++ /Users/martina/Projekte/TurboGears/turbogears/widgets/
__init__.py (working copy)
@@ -1,3 +1,5 @@
from base import *
from forms import *
+from grid import *
+
This patch fixed the Grid widget so that it displays sample data:
Index: /Users/martina/Projekte/TurboGears/turbogears/widgets/grid.py
===================================================================
--- /Users/martina/Projekte/TurboGears/turbogears/widgets/grid.py
(revision 516)
+++ /Users/martina/Projekte/TurboGears/turbogears/widgets/grid.py
(working copy)
@@ -37,8 +37,10 @@
def __init__(self,name="grid",rows=None,headers=None,**kw):
self.name = name
- self.headers=headers
- self.rows=rows
+ if headers:
+ self.headers=headers
+ if rows:
+ self.rows=rows
def source(self):
return self.render(None, format="xml")
ciao
Martina
ciao
Martina