I have implemented ag-Grid by using angular in my project successfully. Now trying to print ag-Grid data through following official ag-Grid doc https://www.ag-grid.com/javascript-grid-for-print/ .
I'm calling that print functionality method under onCellDoubleClicked() method. While double click a cell, ag-grid data print window should open. But I'm getting error like 'ERROR TypeError: l.setDomLayout is not a function'.
This is the way I've created method.
onCellDoubleClicked($event) {
var gridApi = this.gridApi;
this.setPrinterFriendly(gridApi);
setTimeout(function() {
print();
this.setNormal(gridApi);
}, 2000);
}
setPrinterFriendly(api) {
var eGridDiv = document.querySelector(".my-grid");
this.style.width = "";
this.style.height = "";
api.setDomLayout("print");
}
setNormal(api) {
var eGridDiv = document.querySelector(".my-grid");
this.style.width = "600px";
this.style.height = "200px";
api.setDomLayout(null);
}
Any one having idea please let me know, Is any thing I did wrong or correct approach. Thanks in advance.
This is the error:

api.setDomLayout("print");, you dothis.gridApi.setDomLayout("print");? - Akber Iqbal