tabulator icon indicating copy to clipboard operation
tabulator copied to clipboard

Allow history module to track row movement in grouped rows

Open Sotiris-k opened this issue 2 years ago • 2 comments

Describe the bug Once you setup a table with data containing groups, setting the rows movable and setting the history to true, the console throws the error below Uncaught TypeError: t.getPosition is not a function at a.value (History.js:37:70) at InternalEventBus.js:119:25 at Array.forEach () at e.value (InternalEventBus.js:118:21) at s.value (CoreFeature.js:78:30) at s.value (RowManager.js:419:8) at s.value (MoveRows.js:358:27)

Tabulator Info

  • 5.3.4

Working Example https://jsfiddle.net/xben86zL/11/

To Reproduce A step by step guide to recreate the issue in your JS Fiddle or Codepen:

  1. Move the first row of the first group to the second group
  2. See error in console

Expected behavior No error should be thrown.

Desktop (please complete the following information):

  • OS: Win 10
  • Browser: Edge
  • Version: 105.0.1343.42 (Official build) (64-bit)

Additional context Some basic debugging showed that in History.js:36 the "to" variable instead of receiving a row, it receives a group henceforth there's no getPosition() method available

Sotiris-k avatar Sep 23 '22 09:09 Sotiris-k

Hey @Sotiris-k

Thanks for getting in touch,

At the moment the history module isn't really compatible with row movement in grouped rows. Though this isn't clearly documented on the website.

I will update the docs to add a warning, but this will be a complex update to the module, for a reasonably unusual set of combined features, so it wont be top of the todo list.

Feel free to submit a PR if it is something you would like to see sooner.

Cheers

Oli :)

olifolkerd avatar Sep 25 '22 13:09 olifolkerd

Hi @olifolkerd ,

That's a fair assessment.

Thank you for the explanation.

Sotiris-k avatar Sep 25 '22 19:09 Sotiris-k