Update of /cvsroot/jtoolkit/jToolkit/widgets
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16475
Modified Files:
grid.py
Log Message:
made SimpleGrid's hrefbase optional
Index: grid.py
===================================================================
RCS file: /cvsroot/jtoolkit/jToolkit/widgets/grid.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** grid.py 9 Feb 2004 14:31:29 -0000 1.6
--- grid.py 9 Feb 2004 14:32:26 -0000 1.7
***************
*** 219,228 ****
style['text-decoration'] = 'none'
# we need to set the style in both objects otherwise the link style can override it
! contents = widgets.Link(href, text, {'target':hreftarget,'style':style})
return table.TableCell(contents, newattribs={'valign':'top','style':style})
class SimpleGrid(Grid):
"""a grid with common methods for config pages"""
! def __init__(self, gridtable, columnlist, hrefbase, hreftarget='', colordefs={}, colordeps={}, headingcolumns=(), hidecolumns=(), filter=None):
self.hrefbase = hrefbase
self.hreftarget = hreftarget
--- 219,231 ----
style['text-decoration'] = 'none'
# we need to set the style in both objects otherwise the link style can override it
! if href is None:
! contents = text
! else:
! contents = widgets.Link(href, text, {'target':hreftarget,'style':style})
return table.TableCell(contents, newattribs={'valign':'top','style':style})
class SimpleGrid(Grid):
"""a grid with common methods for config pages"""
! def __init__(self, gridtable, columnlist, hrefbase=None, hreftarget='', colordefs={}, colordeps={}, headingcolumns=(), hidecolumns=(), filter=None):
self.hrefbase = hrefbase
self.hreftarget = hreftarget
***************
*** 279,288 ****
"""adds all the cells for a row to the grid"""
rowid = self.gridtable.getrowid(row)
! href = self.hrefbase
! if '?' in href:
! href += "&"
! else:
! href += "?"
! href += 'action=view&' + self.gridtable.rowidparamstring(rowid)
rownum = self.maxrownum() + 1
for category in self.categories:
--- 282,292 ----
"""adds all the cells for a row to the grid"""
rowid = self.gridtable.getrowid(row)
! if selfhrefbase is not None:
! href = self.hrefbase
! if '?' in href:
! href += "&"
! else:
! href += "?"
! href += 'action=view&' + self.gridtable.rowidparamstring(rowid)
rownum = self.maxrownum() + 1
for category in self.categories:
|