Topic: How to rowReorder or delete a row in Datatable

Pelle Widell priority asked 3 years ago

Expected behavior

For Table Editable you have a reorder function but just up/down

Actual behavior

I want to be able to reorder tablerows with a drag-icon, like some other. It's ok if this is an PRO feature but to rearrange multiple steps is timeconsuming if you only can sort one step at the time

Resources (screenshots, code snippets etc.)

Marcin Luczak staff answered 3 years ago

Hi Pelle Widell,

Table Editor doesn't support draggable functionality itself, however, you can use Sortable to achieve this. Just add id to your <tbody> tag on which you will initialize Sortable via jQuery method. In the example I've created for you I've added cursor changing classes to each table element to indicate the possibility to drag the element. I've also provided an option to show a placeholder background for moving items. Please see my snippet below:

Best regards, Marcin

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: all
  • Browser: Chrome
  • OS: Win 10
  • Provided sample code: No
  • Provided link: Yes