Laravel + Inertia Vue2, HOT instance is destroyed

Tags: #<Tag:0x00007efc718b2c88>

The routing in our Laravel/Inertia/Vue2 stack doesn’t reload browser’s window.
We have 2 places on the website where using implementation of HOT.
When I enter second place, the script reports me that some core methods can not be called due to destroyed instance.
How can I re-render the hot instance ?

Hi @l.linczewski

Is there any way we can replicate the issue locally without Laravel? I checked the Github and did not find any related issues.

ps. Here’s a tutorial on how to set up a reference to the instance https://handsontable.com/docs/javascript-data-grid/vue-hot-reference/ and after that you call the Core render() method.

I have found the solution.
Previously I added ‘afterChange’ hook in ‘mouted’ lifecycle method like so:
mounted() {
const hot = this.$refs.hotTableComponent.hotInstance;
Handsontable.hooks.add(‘afterChange’, (changes) => {
hot.getData(); // error here
}
}

and finally moved the hook to ‘hotSettings’ object as a callback method wbich solve the problem
“data” : {
“hotSettings” : {
afterChange: (changes) => {
const hot = this.$refs.hotTableComponent.hotInstance;
hot.getData(); // working here !
}
}
}

1 Like

Thank you for the update. I’m closing the thread.