dgrid
dgrid copied to clipboard
ColumnResizer and ColumnSet
Hi, When mousedown to resize a column in ColumnSet, fire the event of 'dgrid-cellfocusin', so ColumnSet call _onColumnSetCellFocus to _scrollColumnSet. This cause the dgrid-resize-handle's position not correct. Therefore, it needs to filter out the dgrid-resize-handle.
_onColumnSetCellFocus: function (event, columnSetNode) {
var focusedNode = event.target;
/// 排除 resize-handle
if(focusedNode.className.indexOf("dgrid-resize-handle") >= 0){
return;
}
var columnSetId = columnSetNode.getAttribute(colsetidAttr),
// columnSetNode's offsetLeft is not always correct,
// so get the columnScroller to check offsetLeft against
columnScroller = this._columnSetScrollers[columnSetId],
elementEdge = focusedNode.offsetLeft - columnScroller.scrollLeft + focusedNode.offsetWidth;
if (elementEdge > columnSetNode.offsetWidth || columnScroller.scrollLeft > focusedNode.offsetLeft) {
this._scrollColumnSet(columnSetNode, focusedNode.offsetLeft);
}
}
I observed the same problem using dgrid-0.3.18-dev. The hack suggested by @riaeasy works for me.
Our Dgrid hierarchy : OnDemanGrid, ColumnHider, ColumnResizer, CompoundColumns, ColumnSet, Selection, Keyboard
Also observed with dgrid-1.3.1. The hack suggested by @riaeasy also works here.
The Dgrid hierarchy : OnDemanGrid, ColumnHider, ColumnResizer, CompoundColumns, ColumnSet, Selection, Keyboard, Editor