View Single Post
  #4 (permalink)  
Old 12-09-2005, 06:16 AM
jpenguin jpenguin is offline
Junior Member
 
Posts: 5
Default

I found the bug. There are 2 problems I see. At the end of DwtListView.prototype._handleColHeaderResize ()
it should determine where to redraw the column resize sash by subtracting the Dwt parent widget HTML element's X (relative to the window) from the mouse event X (relative to the window too), the first problem is this method is subtracting parent HTML element's offset relative to its parent (when the parent widget is absolute instead of static style) instead. The 2nd problem I see is that the DvListView widget (which has a static style) needlessly overrides DwtListView's _getParentForColResize() method so that the method returns its parent widget, a DwtTabView (absolute style). These two factors combined cause the offset calculation to be off, in this case it's off by the width of the non-Dwt HTML div into which the tab view is set child of.

I don't see why anyone want to override _getParentForColResize(). So I see 2 fixes here:

1. Do not override _getParentForColResize() under any circumstances.
2. Change DwtListView.prototype._handleColHeaderResize () so it always calculate offsets relative to the window, i.e. the last 3 lines are changed to :
var parent = this._getParentForColResize();
var loc = Dwt.toWindow(parent.getHtmlElement(), 0 ,0);
Dwt.setLocation(this._headerSash, ev.docX-loc.x);

from
var parent = this._getParentForColResize();
var loc = parent.getLocation();
Dwt.setLocation(this._headerSash, ev.docX-loc.x);


Either of these 2 fixed the problem for me, and I applied both.
__________________
jpenguin
Reply With Quote