Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / RowDragConfig

Interface: RowDragConfig<TRow>

Defined in: datagrid-react/src/hooks/useRowDrag.ts:57

Type Parameters

TRow

TRow = GridRowData

Properties

allowDropInsert?

optional allowDropInsert?: boolean

Defined in: datagrid-react/src/hooks/useRowDrag.ts:68

Accept rows from another grid in the group. Default true when group is set.


allowReordering?

optional allowReordering?: boolean

Defined in: datagrid-react/src/hooks/useRowDrag.ts:66

Reordering within this grid. Default true.


enabled?

optional enabled?: boolean

Defined in: datagrid-react/src/hooks/useRowDrag.ts:58


group?

optional group?: string

Defined in: datagrid-react/src/hooks/useRowDrag.ts:64

Grids sharing a group can exchange rows. Without one a grid only reorders its own rows — dropping into an unrelated grid on the same page is almost never what the user meant.


onAdd?

optional onAdd?: (event) => void

Defined in: datagrid-react/src/hooks/useRowDrag.ts:76

A row arrived from another grid.

Parameters

event

RowDropEvent<TRow>

Returns

void


onRemove?

optional onRemove?: (event) => void

Defined in: datagrid-react/src/hooks/useRowDrag.ts:78

A row of THIS grid was accepted by another one.

Parameters

event

RowDropEvent<TRow>

Returns

void


onReorder?

optional onReorder?: (event) => void

Defined in: datagrid-react/src/hooks/useRowDrag.ts:74

A row was moved within this grid. Without a handler the grid reorders its own source array; with one, YOU own the order (persist it, update your sort field) and the grid does nothing on its own.

Parameters

event

RowReorderEvent<TRow>

Returns

void