Skip to content

RowReorder

Reference

DataTables is often used to show sequential data, and naturally from that comes the desire to be able to reorder that data - for this the RowReorder extension is available. It provides the end user with the ability to click and drag (or touch and drag on mobile devices) a row in the table and change its position. Full integration with Editor's multi-row editing abilities is also available to have updates automatically written to a database.

Enable the RowReorder extension for DataTables.

.RowReorder(true)
Or, configure it.
.RowReorder(r => r.DataSrc("sequence").Editor("editor"))

Cancelable

Enable / disable the canceling of the drag and drop interaction.

.Cancelable(false)

DataSrc

Configure the data point that will be used for the reordering data.

.DataSrc("sequence")

Editor

Attach an Editor instance for database updating.

.Editor("editor")

Enable

Enable / disable RowReorder's user interaction.

.Enable(false)

FormOptions

Set the options for the Editor form when submitting data.

.FormOptions("allIfChanged")

Selector

Define the selector used to pick the elements that will start a drag.

.Selector("td:last-child")

SnapX

Horizontal position control of the row being dragged.

.SnapX(true)

Update

Control automatic of data when a row is dropped.

.Update(false)