loadData() breaks column filters

Tags: #<Tag:0x00007efc656da390>

After applying column filters and loading new data via loadData(), the filter menu behaves weirdly.

  • Open this fiddle: http://jsfiddle.net/do23rv6x/1/
  • Filter column A to hide “Lorem”
  • Load new data via the any of the buttons (rerun before pressing another button)
    • Result for 1st button: The table contains only 1 row, and you can only filter 1 value for column A. No way to display the second column.
    • Result for 2nd button: The table contains only 1 row, but the filter menu still contains all old value, even those that don’t exist in the data anymore
    • Result for 3rd button: The table contains 2 rows, filters are reset and work properly

In either case I would at least expect the filter values to match the actual data value, but this only applies to the 3rd case where we disable and re-enable the Filters plugin. This works as a workaround but doesn’t seem correct.

Thank you for sharing the example and scenario.

In the example we have version 1.10.2. However, I have also check the latest 1.15.1 and changed the clearing method (line 36) from

hot.getPlugin("filters").clearFormulas();

to

hot.getPlugin("filters").clearConditions();

which end up with the same result.

It is definitely a bug. We need to check it.

Hi @jonas.witt

we just officially fixed https://github.com/handsontable/handsontable/issues/5244 Thank you for the input :slight_smile: