Hello,
We are using Hansontable quite intensively and are currently facing an issue.
Basically when at least one row is trimmed using TrimRows plugin and then inserting rows using context menu actions row_above/row_below is inserting rows with wrong physical indexes.
Please have a look at this JSFiddle: https://jsfiddle.net/t413Lubn/4/ and do the following actions:
- Right click row number 2
- Click on context menu action “Trim Row”
- Right click row number 4
- Click on context menu action “Insert row below”. Everything still looks correct.
- Right click row number 6
- Click on context menu action “Trim Row”. There we expect that the newly inserted row would be the last one but it’s not. It jumped one row above.
I also saved another version of the JSFiddle: https://jsfiddle.net/t413Lubn/5/ where I provide my own callback for row_above/row_below.
There I use alter method with action insert_row using the physical index (hot.toPhysicalRow) of the row.
But even there the result is not as expected.
Not 100% sure but I have the impression it’s linked to this issue: https://github.com/handsontable/handsontable/issues/5112.
But it would be nice if there is already have a way to fix our problem before the above issue is fixed (I’m open to a dirty/manual solution that would work).