tabulator
tabulator copied to clipboard
Cell "edited" flag is lost on changing page when using either layoutColumnsOnNewData: true or rowHeader: { frozen: true }
Describe the bug
When creating a table with the usual new tabulator.Tabulator("#table-container", {
, using ANY of the following two attributes as options?: tabulator.Options:
layoutColumnsOnNewData: true
or rowHeader: { frozen: true }
will break edited flag on a cell on paging.
So technically they both kill the functionality separately. This is rather 2 bugs than one, feel free to separate them.
Tabulator Info 6.2.1
Working Example https://jsfiddle.net/echwrqzm/
To Reproduce
- edit the only editable cell (Mary May) and press enter
- navigate to page 2 and check console: table.getEditedCells() has one element
- navigate back to page 1 and check console: table.getEditedCells() becomes empty (with layoutColumnsOnNewData: true even clickin on the SAME page index down at the bottom in the pager clears the getEditedCells array)
Expected behavior
Changes (changed values and "edited" flag on the cell so technically the new value and the initial values as well) should be kept navigating to any page back and forth. Logic should not remove the "edited" flag without having explicitly calling the following:
cell.restoreInitialValue()
or cell.clearEdited()
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Chrome, latest, FF latest (supposedly browser independent)
Additional context This is clearly a bug as turning these seemingly non-edit affecting setting off will make the issue disappear. It would be important to have a fix for these as this is supposed to be an important feature to keep changes on paging. Also, behavior is quite misleading due to the nature of the bug, since edited values are retained in a bad way, with clearing the "edited" flag, making it look like these cells have always contained their new value, but this was not the case. If the intention is to clear all changed cells upon paging (which would be a disaster and I think no other products act like this, they try to keep changes upon rendering a new page, what would be a deal of losing them with a simple rerender?) it should be consistent and clear them as soon as leaving the first page. Not when you return to original page of the changed cells.