olifolkerd / tabulator

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

SelectableCheck is not executed updated rows #4143

Open kermit-the-frog opened 1 year ago

kermit-the-frog commented 1 year ago

Describe the bug I've a table with a custom selectableCheck function. The result of this function depends on the rowData. It works perfectly on table initialization but not when I update the data. The selectable state of updated rows does not change.

Tabulator Info Tabulator version 5.4.4

Working Example https://jsfiddle.net/6uhLzk1y/1/

To Reproduce

  1. Go to https://jsfiddle.net/6uhLzk1y/1/
  2. Click on 'Run'
  3. Hover over the table rows => the background color changes in the first and last line. That's because these lines are fulfil the selectableCheck
  4. Click on 'Toggle selectable' => table data is updated
  5. Hover over the table rows => the background color changes in the first and last line. That's wrong because these lines don't fulfil the selectableCheck

Expected behavior The selectableCheck has to be executed for each updated row.

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

AmolPawar7181 commented 1 year ago

Hi @kermit-the-frog, can you try replaceData() method?

kermit-the-frog commented 1 year ago

Hi @kermit-the-frog, can you try replaceData() method?

replaceData() works in the given jsfiddle. But that's an very reduced version of my code. Actually my code does not change the data of all rows. Though I cannot use replaceData and have to use updateData.