Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Draggable Grouping drop zone in preheader should take full width #1025

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/models/gridOption.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ export interface GridOption<C extends BaseColumn = BaseColumn> {
/** Extra pre-header panel height (on top of column header) */
preHeaderPanelHeight?: number;

/** Defaults to "auto", extra pre-header panel (on top of column header) width, it could be a number (pixels) or a string ("100%" or "auto") */
preHeaderPanelWidth?: number | string;

/** Do we want to preserve copied selection on paste? */
preserveCopiedSelectionOnPaste?: boolean;

Expand Down
5 changes: 3 additions & 2 deletions src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
preHeaderPanelHeight: 25,
showTopPanel: false,
topPanelHeight: 25,
preHeaderPanelWidth: 'auto', // mostly useful for Draggable Grouping dropzone to take full width
formatterFactory: null,
editorFactory: null,
cellFlashingCssClass: 'flashing',
Expand Down Expand Up @@ -1230,7 +1231,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
Utils.width(this._footerRowR, this.canvasWidthR);
}
if (this._options.createPreHeaderPanel) {
Utils.width(this._preHeaderPanel, this.canvasWidth);
Utils.width(this._preHeaderPanel, this._options.preHeaderPanelWidth ?? this.canvasWidth);
}
Utils.width(this._viewportTopL, this.canvasWidthL);
Utils.width(this._viewportTopR, this.viewportW - this.canvasWidthL);
Expand All @@ -1257,7 +1258,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
}

if (this._options.createPreHeaderPanel) {
Utils.width(this._preHeaderPanel, this.canvasWidth);
Utils.width(this._preHeaderPanel, this._options.preHeaderPanelWidth ?? this.canvasWidth);
}
Utils.width(this._viewportTopL, '100%');

Expand Down