Your search did not match any results.

Tab Panel - Tab Drag & Drop

This demo illustrates how you can allow end-users to reorder, add, and remove tabs within the DevExtreme TabPanel component.

Backend API

Reorder tabs

Wrap the TabPanel into the Sortable component and set the following properties as needed:

  • filter
    Specify a CSS selector to indicate draggable items. This demo sets filter to .dx-tab.

  • itemOrientation
    Set this property to "horizontal". When a user drags a tab, remaining items move left and right to designate the drop target.

  • onDragStart and onReorder
    Implement these handlers to configure drag and drop logic and modify the dataSource after the tabs are reordered.

Add or remove tabs

This demo adds and removes tabs in the following two functions:

  • addButtonHandler - a click handler for the "Add Tab" button.
  • closeButtonHandler - a click handler for a tab's Close icon. The demo uses the itemTitleTemplate property to display this icon.

Both handlers modify the TabPanel's dataSource.