Handsontable Angular Events lose reference to component

Tags: #<Tag:0x00007fc4672d24d0>

I am using Handsontable with Angular with Angular 6 wrapper.

I am listening to afterSelectionEnd event using this

<hot-table
  [data]="ssData"
  [rowHeaders]="true"
  [colHeaders]="columns"
  [columns]="columnDef"
  [colWidths]="colWidths"
  [outsideClickDeselects]=false
  [afterSelectionEnd]="afterSelectionEnd"
  >
</hot-table>

I expect the ‘this’ reference point to the component in the afterSelectionEnd() method.

But, the value is null. Is this a known issue or am I doing something wrong?

Any help would be appreciated.

Thanks

Hey @lihigivuca

The first parameter is core, then the coordinates for older versions (before wrapper v 5)

and in the latest, we do not use the core as the first parameter

https://jsfiddle.net/AMBudnik/h1r9oLu2/

Here’s the changelog https://github.com/handsontable/angular-handsontable/releases

Hi Aleksandra,

I understand the arguments but the reference to the component is lost.
In the callback, afterSelectionEnd(), the ‘this’ should refer to the component.

Seems like it is not. Can you provide an example where the selected row and column are stored as fields in component and whose values is set in the afterSelectionEnd() function?

Here is an example on how to get the reference to the instance/component https://handsontable.com/docs/7.1.0/frameworks-wrapper-for-angular-hot-reference.html