diff --git a/src/models/gridOption.interface.ts b/src/models/gridOption.interface.ts index c03123aa..345471cb 100644 --- a/src/models/gridOption.interface.ts +++ b/src/models/gridOption.interface.ts @@ -282,6 +282,12 @@ export interface GridOption { /** Defaults to false, when set to True will sync the column cell resize & apply the column width */ syncColumnCellResize?: boolean; + /** + * Defaults to false, should we throw an erro when frozenColumn is wider than the grid viewport width. + * When that happens the unfrozen section on the right is in a phantom area that is not viewable neither clickable unless we enable double-scroll on the grid container. + */ + throwWhenFrozenNotAllViewable?: boolean; + /** What is the top panel height in pixels (only type the number) */ topPanelHeight?: number; diff --git a/src/slick.grid.ts b/src/slick.grid.ts index c5bee9d2..b12f8b89 100644 --- a/src/slick.grid.ts +++ b/src/slick.grid.ts @@ -249,6 +249,7 @@ export class SlickGrid = Column, O e frozenColumn: -1, frozenRow: -1, frozenRightViewportMinWidth: 100, + throwWhenFrozenNotAllViewable: false, fullWidthRows: false, multiColumnSort: false, numberedMultiColumnSort: false, @@ -1119,7 +1120,7 @@ export class SlickGrid = Column, O e if (this.hasFrozenColumns()) { const cWidth = Utils.width(this._container) || 0; - if (cWidth > 0 && this.canvasWidthL > cWidth) { + if (cWidth > 0 && this.canvasWidthL > cWidth && this._options.throwWhenFrozenNotAllViewable) { throw new Error('[SlickGrid] Frozen columns cannot be wider than the actual grid container width. ' + 'Make sure to have less columns freezed or make your grid container wider'); }