diff --git a/src/app/examples/grid-draggrouping.component.ts b/src/app/examples/grid-draggrouping.component.ts index 2736c72b8..ca14cab1e 100644 --- a/src/app/examples/grid-draggrouping.component.ts +++ b/src/app/examples/grid-draggrouping.component.ts @@ -216,7 +216,6 @@ export class GridDraggableGroupingComponent implements OnInit { preHeaderPanelHeight: 40, enableFiltering: true, enableSorting: true, - enableColumnReorder: true, exportOptions: { sanitizeDataExport: true }, diff --git a/src/app/modules/angular-slickgrid/models/columnReorderFunction.type.ts b/src/app/modules/angular-slickgrid/models/columnReorderFunction.type.ts new file mode 100644 index 000000000..0e5769f00 --- /dev/null +++ b/src/app/modules/angular-slickgrid/models/columnReorderFunction.type.ts @@ -0,0 +1,3 @@ +import { Column, SlickGrid } from './index'; + +export type ColumnReorderFunction = (grid: SlickGrid, headers: HTMLElement[], headerColumnWidthDiff: any, setColumns: (col: Column) => void, setupColumnResize: () => void, columns: Column[], getColumnIndex: number, uid: string, trigger: boolean) => void; diff --git a/src/app/modules/angular-slickgrid/models/draggableGrouping.interface.ts b/src/app/modules/angular-slickgrid/models/draggableGrouping.interface.ts index c341f3ca2..151c84d57 100644 --- a/src/app/modules/angular-slickgrid/models/draggableGrouping.interface.ts +++ b/src/app/modules/angular-slickgrid/models/draggableGrouping.interface.ts @@ -1,4 +1,5 @@ import { Grouping } from './grouping.interface'; +import { ColumnReorderFunction } from './columnReorderFunction.type'; export interface DraggableGrouping { /** an extra CSS class to add to the delete button (default undefined), if deleteIconCssClass && deleteIconImage undefined then slick-groupby-remove-image class will be added */ @@ -35,5 +36,5 @@ export interface DraggableGrouping { clearDroppedGroups?: () => void; /** its function to setup draggable feature agains Header Column, should be passed on grid option. Also possible to pass custom function */ - getSetupColumnReorder?: () => void; + getSetupColumnReorder?: ColumnReorderFunction; } diff --git a/src/app/modules/angular-slickgrid/models/gridOption.interface.ts b/src/app/modules/angular-slickgrid/models/gridOption.interface.ts index b183e74ea..21739caf2 100644 --- a/src/app/modules/angular-slickgrid/models/gridOption.interface.ts +++ b/src/app/modules/angular-slickgrid/models/gridOption.interface.ts @@ -6,6 +6,7 @@ import { CheckboxSelector, Column, ColumnPicker, + ColumnReorderFunction, ContextMenu, DraggableGrouping, EditCommand, @@ -195,7 +196,7 @@ export interface GridOption { enableColumnPicker?: boolean; /** Defaults to true, which permits the user to move an entire column from a position to another. */ - enableColumnReorder?: boolean; + enableColumnReorder?: boolean | ColumnReorderFunction; /** Do we want to enable Context Menu? (mouse right+click) */ enableContextMenu?: boolean; diff --git a/src/app/modules/angular-slickgrid/models/index.ts b/src/app/modules/angular-slickgrid/models/index.ts index 6b8c225d4..74cb6226e 100644 --- a/src/app/modules/angular-slickgrid/models/index.ts +++ b/src/app/modules/angular-slickgrid/models/index.ts @@ -21,6 +21,7 @@ export * from './columnEditorDualInput.interface'; export * from './columnFilter.interface'; export * from './columnFilters.interface'; export * from './columnPicker.interface'; +export * from './columnReorderFunction.type'; export * from './columnSort.interface'; export * from './contextMenu.interface'; export * from './currentColumn.interface';