You can add the reference to this
in grid's context -
this.gridOptions.context = {
thisComponent : this
};
And then, thisComponent
can be access as below -
private getContextMenuItems(params) {
console.log(params);
var result = [
{ // custom item
name: 'Sample',
action: function () {params.context.thisComponent.callMe(); },
icon: '<i class="fa fa-pencil" />'
}];
return result;
}
Same can be done for any other call backs like cellRenderer
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…