afterRemoveRow not firing

Tags: #<Tag:0x00007efc6ad8a618>

I can’t get afterRemoveRow to fire, after highlighting a row and deleting it with the delete key. I’m using this:

      hot.addHook('afterRemoveRow', (row, amount) => {

            alert('afterRemoveRow called.');
        })

I CAN, however, get afterCreateRow to fire, after inserting a blank row, using this:

      hot.addHook('afterCreateRow', (row, amount) => {

            alert('afterCreateRow called.');
        })

Hi @daniel.king

By pressing the delete key you are not deleting the row, but just clear the data. That’s why the hook doesn’t fire up.

Please, check this example: https://jsfiddle.net/aszymanski/vsc98abt/16/

When I add the row from context menu the alert shows up and also when I delete the row from context menu the alert will show up.

Thank you very much, Adrian. I noticed that little square icon at the lower right corner of the highlighted row, but it clicking it wasn’t bringing up the menu that allowed me to remove rows. Then I noticed in your example that you had the HOT attribute: contextMenu: true. That’s what I was missing.

Hitting the Delete key does remove values from a highlighted row, which could be confusing. I guess I can use the afterDocumentKeyDown and beforeChange hooks to block that.

Hi @daniel.king

I’m glad that I could help. Can I considered this ticket closed?

I believe that we can close this thread as there is no update for a month.