getInstance (Handsontable 14.6) in Javascript

Tags: #<Tag:0x00007efc609cca30> #<Tag:0x00007efc609cc850>

I am migrating Handsontable 9 to 14.6 and I want to know if in (handsontable 14.6) to get an instance is still used:
var hot = $("#dvHand").Handsontable(“getIntance”);

Hi @jeiorio

Thank you for contacting us. We didn’t change the way of declaring the Handsontable instance between those two versions. The recommended way of doing this can be found in this example: https://jsfiddle.net/handsoncode/wntey82c/

Hello!
In Handsontable 14.6, the method you mentioned ($("#dvHand").Handsontable(“getInstance”)) is no longer valid. Handsontable has moved away from the jQuery plugin style and now operates purely as a standalone JavaScript library.

To get the instance of a Handsontable in version 14.6, you would need to directly store the reference when initializing the table. Here’s an example:

javascript
var container = document.getElementById(‘dvHand’);
var hot = new Handsontable(container, {
// configuration options
});

// Later, you can access the instance like this:
console.log(hot); // This is your Handsontable instance
If you have already initialized the Handsontable and want to get the instance, you should ensure that the reference to it is stored somewhere in your code, as there is no longer a built-in “getInstance” method.

Hi @jeffrey597doss

Thank you for your input. The method getInstance is still present and can be used: https://handsontable.com/docs/javascript-data-grid/api/core/#getinstance

It can be declared like this: hot.getInstance()

Thanks for your reply.
Does this mean that any function mentioned in the core can be called from the created instance of handsontable?

Hi @jeiorio

Yes, any method that is described in our documentation as a reference to the core means the Handsontable instance by it.