I have the following constructor function.
function Tablo() {
this.kayit_id = 0;
this.rapor_instanse = 'rapor';
this.kosul_durum = null;
this.tablo_nesne = null;
this.tablo_getir = function() {
this.tablo_nesne = new Handsontable(
document.getElementById(this.rapor_instanse), {
afterGetColHeader: this.arama_filtre_element_ekle,
beforeOnCellMouseDown: this.doNotSelectColumn,
columnSorting: true,
rowHeaders: true,
currentRowClassName: 'currentRow',
wordWrap: false,
licenseKey: 'non-commercial-and-evaluation',
manualColumnResize: true,
manualRowResize: true,
afterSelectionEnd: function(r, c, r2, c2) {
let suppliedarrayobject = this.tablo_nesne.getSourceDataAtRow(
this.tablo_nesne.toPhysicalRow(r)
);
this.kayit_id = suppliedarrayobject.kayit_id;
}
}
);
};
}
I need to access and modify the property tablo_nesne
within the afterSelectionEnd
function. However, the this
keyword points to the wrong context. How do I fix this issue?