Sorted order lost after source data being modified

Tags: #<Tag:0x00007efc6028bcd0>

Hello,

I am using React wrapper of HOT.
The issue is that when the source data of the HOT gets updated, the order in which sorted before will lost.
I created a demo in codepen here:

https://codepen.io/haiqwu/pen/QWjNRPw?editors=0010

To recreate the issue: first sort a column (e.g. click on header of column E ), and then click on the button “clickme”.
Issue: The sorted order will lost. But the header has a mark of arrow pointing up which indicates already sorted.

Any solution to this?
Maybe I need to get the status of the sorted header, and manually sort the data by my self in code?

Best,
Marius

Hi Marius.

You could use an outsideClickDeselects option.
Here is a link to docs - https://handsontable.com/docs/7.4.2/Options.html#outsideClickDeselects

With this option, filtered data don’t change.

The main thing, what should happen after clicking this button?
If you reorder data after click it could be reflected in the table.

Hey Marius,

that is a desired behavior. However, you can check the persistentState https://handsontable.com/docs/7.4.2/Options.html#persistentState Let me know if it works the way you wanted.

Thanks !!