Skip to content

Commit

Permalink
fix: add missing RowMoveManager containerCssClass option (#906)
Browse files Browse the repository at this point in the history
* fix: add missing RowMoveManager `containerCssClass` option
  • Loading branch information
ghiscoding authored Nov 2, 2023
1 parent fb0e4f5 commit 5f85574
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/example-drag-row-between-grids.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ <h2>View Source:</h2>
behavior: "selectAndMove",
selectable: false,
resizable: false,
cssClass: "cell-drag-cross-grid dnd sgi sgi-drag sgi-14px",
cssClass: "cell-drag-cross-grid dnd",
formatter: () => `<span class="sgi sgi-drag"></span>`
},
{
id: "name",
Expand Down
3 changes: 2 additions & 1 deletion examples/example-frozen-row-reordering.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ <h2>
behavior: "selectAndMove",
selectable: false,
resizable: false,
cssClass: "cell-reorder dnd sgi sgi-drag sgi-14px",
cssClass: "cell-reorder dnd",
formatter: () => `<span class="sgi sgi-drag"></span>`
},
{
id: "name",
Expand Down
3 changes: 2 additions & 1 deletion examples/example9-row-reordering-simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ <h2>View Source:</h2>
behavior: "selectAndMove",
selectable: false,
resizable: false,
cssClass: "slickgrid-cell-reorder sgi sgi-drag sgi-14px"
cssClass: "slickgrid-cell-reorder",
formatter: () => `<span class="sgi sgi-drag"></span>`
},
{
id: "name",
Expand Down
3 changes: 2 additions & 1 deletion examples/example9-row-reordering.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ <h2>View Source:</h2>
behavior: "selectAndMove",
selectable: false,
resizable: false,
cssClass: "cell-reorder dnd sgi sgi-drag sgi-14px"
cssClass: "cell-reorder dnd",
formatter: () => `<span class="sgi sgi-drag"></span>`
},
{
id: "name",
Expand Down
3 changes: 3 additions & 0 deletions src/models/rowMoveManagerOption.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export interface RowMoveManagerOption {
/** A CSS class to be added to the div of the cell formatter. */
cssClass?: string;

/** A CSS class to be added to the cell container. */
containerCssClass?: string;

/** Column definition id(defaults to "_move") */
columnId?: string;

Expand Down
6 changes: 5 additions & 1 deletion src/plugins/slick.rowmovemanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Utils = IIFE_ONLY ? Slick.Utils : Utils_;

/**
* Row Move Manager options:
* containerCssClass: A CSS class to be added to the cell container.
* cssClass: A CSS class to be added to the div of the cell formatter.
* columnId: Column definition id (defaults to "_move")
* cancelEditOnDrag: Do we want to cancel any Editing while dragging a row (defaults to false)
Expand Down Expand Up @@ -250,7 +251,10 @@ export class SlickRowMoveManager {
if (!this.checkUsabilityOverride(row, dataContext, grid)) {
return '';
} else {
return { addClasses: `cell-reorder dnd ${this._options.cssClass || ''}`.trim(), text: '' };
return {
addClasses: `cell-reorder dnd ${this._options.containerCssClass || ''}`,
text: `<div class="${this._options.cssClass}"></div>`
};
}
}

Expand Down

0 comments on commit 5f85574

Please sign in to comment.