Upgraded handsontable LoadData() cause issue while copy paste

Tags: #<Tag:0x00007efc835ee198> #<Tag:0x00007efc83609920>

Hi Team,

I migrated the angular project from v14 to v17 and update the handsontable to v14.1.I am using loadData() with in afterChange() hook for copy paste scenario. When doing first time copy paste it is working and second time, paste the value in another cell in another column but that value is showing in table but not reflecting in data source. Hence paste value is not reflecting in data after first action.

ex:
afterChange: (changes, source) => {
if (source === ‘CopyPaste.paste’) {
const hot = this.dataExplorerGrid.HandsonTableInstance;
const myData = hot.getSourceData();
const convertedData = this.updateMydataWithPasteValue(myData, changes);

hot.loadData(convertedData);
}
}

when I removed the “hot.loadData(convertedData);” copy paste working fine and value reflecting in the data.

Please give me the solution. Advance thanks.

Hi @saravanan.m

Can you please tell me from which version of Handsontable did you updated? In v. 11.1.0 we added a new method updateData() that let you update the data without resetting the state of the table.

Hi @adrian.szymanski,

I updated the handsontable version from v7 to v14.1. I just tried with updateData() and it is not resolved our issue.

@saravanan.m

Thank you. Since v.7 we introduced many breaking changes. I recommend going through our migration guides to see if there’s anything that might have an impact on your code. Here’s the first one, and the rest you can find in the menu: https://handsontable.com/docs/react-data-grid/migration-from-7.4-to-8.0/

@adrian.szymanski,

We already checked the documents and updated by gone through the migration guide only. We are not have any other issue other than copy paste because of loadData(). Please give any other suggestion.

@saravanan.m

Ok, please send a code demo where the issue is replicable, so I can debug it and see what the problem is.

Hi @adrian.szymanski,

I am manually updating the store, now copy paste working fine thanks.

Hi @saravanan.m

Thank you for the update. I will close this topic then.