olifolkerd / tabulator

Interactive Tables and Data Grids for JavaScript
http://tabulator.info
MIT License
6.77k stars 821 forks source link

Moveable Rows in Data Tree #1604

Open gerrybardo opened 6 years ago

gerrybardo commented 6 years ago

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

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):

Additional context Add any other context about the problem here.

olifolkerd commented 6 years ago

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 :)

Alarich commented 5 years ago

@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.

olifolkerd commented 5 years ago

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

domtoupin commented 5 years ago

@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!

michael-ts commented 5 years ago

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.

wajdijurry commented 3 years ago

+1

eouia commented 9 months ago

Still any progress?