Search code examples
javascripttabulator

Keep the selection while scrolling in Tabulator


I have a lot of data and I need to create a button, or when I click, I take all the selected lines.

However, when scrolling down, the lines selected at the top are deselected due to the virtual DOM, which is problematic.

Is there a way to save the selected lines while scrolling?

thank you


Solution

  • If you can provide an example of what you are currently doing, I can look at it. However, it seems to work correctly for me.

    I am using getSelectedData, to get the data, but if you want the row component instead, use getSelectedRows.

    Here is an example with 10000 rows. https://jsfiddle.net/70odrgpj/

    Create the table. Select the rows. Call table.getSelectedData() to get the selected rows. This returns the rows, even if they are not currently rendered in the HTML

    (In this case table is the Tabulator object. If you don't have the reference, you can use Tabulator.prototype.findTable('table-selector') to get a list of Tabulator's matching the 'table-selector'.)