dabo Commit
Revision 5283
Date: 2009-06-30 13:18:26 -0700 (Tue, 30 Jun 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5283
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
Log:
Added Value property to dColumn, which is readonly and allows for getting the
current value of a row/column even if the row is currently invisible.
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2009-06-30 17:41:38 UTC (rev 5282)
+++ trunk/dabo/ui/uiwx/dGrid.py 2009-06-30 20:18:26 UTC (rev 5283)
@@ -1354,7 +1354,18 @@
else:
self._properties["Sortable"] = val
+
+ def _getValue(self):
+ grid = self.Parent
+ biz = grid.getBizobj()
+ if self.DataField:
+ if biz and (grid.CurrentRow < biz.RowCount):
+ return biz.getFieldVal(self.DataField)
+ if grid.DataSet:
+ return
grid.DataSet[grid.CurrentRow][self.DataField]
+ return None
+
def _getVerticalAlignment(self):
mapping = {wx.ALIGN_TOP: "Top", wx.ALIGN_BOTTOM: "Bottom",
wx.ALIGN_CENTRE: "Center"}
@@ -1633,6 +1644,9 @@
_("""Specifies whether this column can be sorted.
Default: True. The grid's
Sortable property will override this setting.
(bool)"""))
+ Value = property(_getValue, None, None,
+ _("""Returns the current value of the column from the
underlying dataset or bizobj."""))
+
VerticalAlignment = property(_getVerticalAlignment,
_setVerticalAlignment, None,
_("""Vertical alignment for all cells in this column.
Acceptable values
are 'Top', 'Center', and 'Bottom'. (str)"""))
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]