Calling loadData resets all the states

Tags: #<Tag:0x00007f8b1df23bb8>

Hi,

According to the doc, after HT 8, loadData will reset all the states of the table. This has a bigger impact since a simple refresh data in the table will lose all the states that are placed on the table.

I see someone has propose to have another method like updateData that updates the data in the table without losing the state.

Is the HT team planning this feature in the near release?

Thanks,

Hi @lijigang.us,
Yes, we do! Our CTO reported the issue you shared :slight_smile:
At the moment, we do not have any ETA for that.

You can track work progress using GH notifications (on the right side of the issue, you can find the “subscribe” button. Alternatively, you can enable product notification in notification settings on https://my.handsontable.com.

Thanks @piotr.laszczkowski

What is the recommended way to keep(reapply) the state after loading the new data for now?

Handsontable’s architecture assumes you store all data in the memory. A new dataset often means other filters, another data to sort, maybe even a different data structure. So clearing plugins’ states seemed to be expected behaviour.

If you need to modify that behaviour, you need to get and store plugins’ configuration before you call loadData and then use plugins’ API to reapply state. You can get a reference to plugins’ instances using getPlugin().
Moreover, Handsontable supports grouping actions into a batch. Read more about batching in our documentation in “Batch operations” guide.