afterChange and afterDrawSelection hook

Tags: #<Tag:0x00007efc6ddfcff8>

Hello,

I am working on updating a whole row instead of per cell. I am using afterDrawSelection hook to know if the row has moved from one row to the other. However, I am encountering issues on this scenarios:

1.) After changing the last cell of a row then pressing TAB or clicking to other row, the afterDrawSelection gets called first before afterChange. But when I hit enter, pressed arrow up or down, the afterChange gets called first before afterDrawSelection.

Is there a way to always fire the afterChange first before afterDrawSelection? I can’t understand why TABBING (at end of row) or clicking on other row fires afterDrawSelection before afterChange…

Hi @eabardies

There is no API for changing the order of hooks. But generally afterDrawSelection is called before each afterChange. I guess that you might want to use afterBeginEditing instead of the selection hook. Here’s an example https://jsfiddle.net/handsoncode/dab13Lqc/
Please let me know if we are heading in the right direction.

ps. You may also want to take a look at the rowIndexMapper. It was made to track the movement of row indexes.