dgrid icon indicating copy to clipboard operation
dgrid copied to clipboard

ColumnResizer and ColumnSet

Open riaeasy opened this issue 8 years ago • 2 comments

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);
        }
    }

riaeasy avatar Apr 02 '16 06:04 riaeasy

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

claudeG avatar Sep 14 '20 15:09 claudeG

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

claudeG avatar Sep 14 '20 16:09 claudeG