Tabulator: Moveable Rows in Data Tree

Created on 26 Nov 2018  路  5Comments  路  Source: olifolkerd/tabulator

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.

Enhancement

Most helpful comment

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

All 5 comments

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

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings