Skip to main content

dragItem

Pro version only

This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
In case you use GPL version, you will be able to reorder rows only.

Optional. Enables the possibility to reorder grid columns or (and) rows by drag and drop

dragItem?: "column" | "row" | "both";

Example

const grid = new dhx.Grid("grid_container", {
columns: [
// columns config
],
dragItem: "both",
data: dataset
});

Related sample: Grid. Drag-n-drop

Drag-n-drop can work in three modes:

  • "column" - enables drag and drop of columns
  • "row" - enables drag and drop of rows
  • "both" - enables both modes mentioned above
info

Enable multiselection of rows to allow a user to drag-n-drop multiple rows at once.

Change log:

  • The "row" and "both" modes were added in v7.2.
  • The property was added in v6.5.