tabulator icon indicating copy to clipboard operation
tabulator copied to clipboard

Moveable Rows in Data Tree

Open gerrybardo opened this issue 7 years ago • 7 comments

Describe the bug Using a DataTree and Moveable rows in One Table. Moving one row to another dataTree Group works visually fine, but if i collapse the dataGroup i moved the row from the row gets reset to their default

Tabulator Info

  • Which version of Tabulator are you using? 4.1.1
  • Post a copy of your construct object if possible so we can see how your table is setup

image

To Reproduce Steps to reproduce the behavior:

  1. Create a Table with two dataTree Groups,
  2. Move a row from one Group to the other
  3. Collapse the Group where the Row comes from
  4. See that the Row resets to its default group

Expected behavior When i Move a Row from one Group to the Other an collapse these Groups, the Rows should stay in Position and not reset to its default

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

  • ubuntu 18.04 LTS
  • Chromium
  • v70

Additional context Add any other context about the problem here.

gerrybardo avatar Nov 26 '18 11:11 gerrybardo

Hey @gerrybardo

Thanks for getting in touch, and sorry to hear you are having troubles.

The dataTree functionality is a new addition to Tabulator, and at the moment will only handle child rows as they are loaded into the table. they cannot be moved between different parents.

This functionality will be coming in a later version of Tabulator.

Cheers

Oli :)

olifolkerd avatar Nov 26 '18 21:11 olifolkerd

@gerrybardo what solution did you end up using?

I have to do something similar soon.

I figure if this is still an issue, as the change by Oli seems to indicate, I could listen to movableRowsReceived, sort out the _children manually in the data and maybe force a redraw if there are problems.

Alarich avatar Feb 16 '19 13:02 Alarich

IThis is a tricky one to implement as it is hard to know at what level you want Tabulator to inser the moved row

olifolkerd avatar Feb 17 '19 18:02 olifolkerd

@olifolkerd This feature is important to us and we would like to contribute to make it happen; could you give us some pointers to get us started so that we are aligned on what is required/expected? Thanks!

domtoupin avatar Aug 20 '19 14:08 domtoupin

I had the same issue just moving nodes with the same parent, but in my case I have an "Order" column that gives the order each item is supposed to be in. If I sort by this column and re-order the elements using this field, it works with the same parent. I think part of the re-ordering problem is sorting, so when I fix the ordering so that it retains the proper sort order.

I'm going to try a similar thing on moving between parents next. The approach I'm going to use is to try to introspect the internal structure and make it match by manually re-parenting and re-ordering.

michael-ts avatar Sep 15 '19 20:09 michael-ts

+1

wajdijurry avatar Jul 09 '21 12:07 wajdijurry

Still any progress?

eouia avatar Feb 07 '24 16:02 eouia