API / Plugins / Base / Column Reorder

ColumnReorderPlugin

The ColumnReorderPlugin from @omnigrid/column-reorder-plugin reorders movable leaf columns when dragged before or after another column header.

Live demo|NPM

Constructor

new ColumnReorderPlugin<T>(options?: ColumnReorderPluginOptions<T>)

Options

Properties accepted by ColumnReorderPluginOptions<T>.

Callbacks

onChange: (columns: ColumnDef<T>[]) => void

Called with the updated column definitions after a successful reorder.

Instance methods

register(api): () => void

Subscribes to column-drop events and reorders the column definitions.

moveColumn(sourceColumnId, targetColumnId, position): boolean

Moves a movable column or group before or after a target column or group. Columns can move between groups but cannot cross pinned-column regions. Dropping after the final leaf in the final group places the column after that group.