main logo
Subject: [dabo-dev] dabo Commit 3600
Author: Paul McNett

Posted: 2007/10/31 13:01:07
 
View Entire Thread
New Search


dabo Commit
Revision 3600
Date: 2007-10-31 11:01:07 -0700 (Wed, 31 Oct 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3600

Changed:
U trunk/dabo/ui/uiwx/dGrid.py

Log:
Fixed a bug introduced recently in dGrid:

1) User presses an up/down arrow key to navigate rows.
2) The grid changes the RowNumber in the biz, via the Form.
3) The form raises RowNumChanged.
4) The grid catches RowNumChanged, and sets the RowNumber...

The end result was a very slow grid navigation experience, coupled with
the row number bouncing back after the user navigated.

Fixed by simply calling refresh() instead of setting grid.CurrentRow.

Also see my comment in ticket #1092.


Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2007-10-30 20:34:55 UTC (rev 3599)
+++ trunk/dabo/ui/uiwx/dGrid.py 2007-10-31 18:01:07 UTC (rev 3600)
@@ -2890,13 +2890,8 @@
##----------------------------------------------------------##
def __onRowNumChanged(self, evt):
# The form reports that the rownum has changed: sync the grid CurrentRow
- if getattr(evt, "bizobj", None) is self.getBizobj():
- try:
- self.CurrentRow = evt.newRowNumber
- except AttributeError:
- pass
+ self.refresh()

-
def _onGridCellEdited(self, evt):
bizobj = self.getBizobj()
row, col = evt.EventData["row"], evt.EventData["col"]
@@ -3729,8 +3724,6 @@
self._dataSet = val
dabo.ui.callAfter(self.refresh)
if self.getBizobj():
- ## I think I want to have the bizobj raise the RowNumChanged event,
- ## but for now this will suffice:
self.Form.bindEvent(dEvents.RowNumChanged, self.__onRowNumChanged)
else:
self._properties["DataSet"] = val
@@ -3755,8 +3748,6 @@
self.fillGrid(True)
biz = self.getBizobj()
if biz:
- ## I think I want to have the bizobj raise the RowNumChanged event,
- ## but for now this will suffice:
self.Form.bindEvent(dEvents.RowNumChanged, self.__onRowNumChanged)
else:
self._properties["DataSource"] = val





 
©2007 Paul McNett
<-- Prior Message New Search Next Message -->