olifolkerd / tabulator

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

table "swallows" some rows after replaceData() or setData() is executed #3380

Closed xtlc closed 2 years ago

xtlc commented 3 years ago

Describe the bug See code. after 5 sec the table correctly updates, but 5 rows are missing. The rows can be found when using the filter function on serial number, so information is "still there" in the virtual DOM I guess. So whenever I click on a new page the last 5 rows. The page size does not matter in that regard, setting it to 50 just makes 20 rows shown and 30 disappear.

I checked additionally that the API always returns the same amount of items, also the number of pages available is not influenced by this.

the height: 100% attribute seems to not influence the change.

workaround i am not happy with Set height: "1000px. I would like to avoid this, because a fixed number of 25 rows without scrolling works when the page loads first.

Tabulator Info

Code

// ********** columns for the table ********** //
cols = [{field: "status", formatter: LED, headerSort:false, maxWidth: "40"},
        {title: "serial", field: "serial", headerFilter: "input"},
        {title: "fw", field: "fw_version"},
        {field: "version"},
        {title: "pcb", field: "pcb.name"},
        {title: "sdcard", field: "sdcard.name"},
        {title: "pi", field: "device_model", formatter: filterPI},
        {title: "shipment", field: "shipment.name", formatter: shipmentSHRT, tooltip: true},
        {headerSort:false, formatter: editBTN, cellClick: editClkd, maxWidth: "40"},
        {headerSort:false, formatter: printBTN, tooltip: prntToolTip, width: "40"},
        {headerSort:false, formatter: cfgBTN, cellClick: cfgClkd, width: "40"}]

// ********** Creating the tabulator instance ********** //
var table = new Tabulator("#table", {height:"100%", pagination: "local", paginationSize: 25, columns: cols,});
setInterval(() => {table.replaceData()}, 5000);

Expected behavior having 25 colums on every page but the last page

Screenshots image

Desktop (please complete the following information):

bornova commented 3 years ago

Hi @xtlc, I found the same question on SO and I will suggest the same solution. The culprit may be the Virtual DOM. As a workaround, try disabling the virtual DOM (virtualDom: false) or set the virtualDomBuffer to a high number bigger than the visible table height. virtualDomBuffer: 2000 for example. Not sure if it will fix your issue but may be worth a try.

xtlc commented 3 years ago

Yes, this was my question :) Changing that did not lead to anything unfortunately. This is why I asked again here. Could you imagine that upgrading to V5 (once released) would be an option to get rid of the problem?

jaguarxii commented 3 years ago

this also happens in version 5.0.7

olifolkerd commented 2 years ago

Hey All,

This was an issue with the way the virtual DOM was handling redraw events, this should be fixed in this weekends patch release.

If you are still having issues after the release, please create a JS fiddle that demonstrates the issue as i currently cannot replicate it on my machine.

Cheers

Oli :)