I am trying to dynamically load ag-grid when a button is clicked, but I have encountered issues with both of my approaches.
Here is my code for the first method:
onBtnClick(){
this.gridOptions ={
onGridReady : function(){
console.log("print");
}
}
}
For the second method, I have the following code:
onBtnClick(){
this.onGridReady();
}
onGridReady(){
this.gridApi = params.api;
console.log("print");
}
Unfortunately, the first method is not working as expected, and the second method is throwing an error saying that 'api' is not defined.