What is the "AddEvent" Method in your documentation?

Tags: #<Tag:0x00007efc72868498> #<Tag:0x00007efc728682b8>

In your previous documentation you often used the “addEvent” method to fire off a click event (or similar). An example is from your “Saving Data” example (link below) where you load the grid with data. You now have updated your example and do it differently, however, before you used to use “addEvent” method.

I cannot find any documentation on that. Is that an internal/custom function/method? Javascript has the “addEventListener” method, but I don’t recall or can find a Javascript method named just “addEvent”. Again, I know you do it differently in your examples now, but I’m still looking for documentation on or understanding of what it is because I’ve been using it and not sure if I should switch.

Link to your current method:

Saving data - JavaScript Data Grid | Handsontable

Previous code snippet from your documentation to load data using the “addEvent” method:

    Handsontable.dom.addEvent(load, 'click', () => {
        ajax('data/json/load.json', 'GET', '', res => {
            const data = JSON.parse(res.response);

            hot.loadData(data.data);
            // or, use `updateData()` to replace `data` without resetting states

            exampleConsole.innerText = 'Data loaded';
        });
    });

Hi @ptownbro

That’s correct. It was our internal solution for handling DOM interactions, but it’s now deprecated and we switched to the native JS methods. We no longer recommend using our previous method.

Ah. Ok. Great. Thanks for the information.

I will close this topic now. If you have any other questions, please open a new one.