0

I find this a bit weird: When I use this customCellRenderer:

 {
      headerName: 'ShowChosenListColumn',
      field: 'chLst',
      cellRenderer: (params) => {
        return(this.chosenListsWithRowIndexes[params.data.chdCol][0] )
      }    },

With that return line:

    return(this.chosenListsWithRowIndexes[params.data.chdCol][0] )

The GridReady event, written in the grid definition:

  (gridReady)="onGridReady($event)"

Doesn't get launched. And so the onGridReady method:

onGridReady(params) {
    this.gridApi = params.api;
    console.log('_______________INSIDE ONGRIDREADY_____________________________________________')
    console.log('this.gridApi: ', this.gridApi);
    console.log('onGridReady WORKSSSSSSSSSSSSSSSSS');
    console.log('_______________INSIDE ONGRIDREADY_____________________________________________')

    params.api.sizeColumnsToFit();

  }

Doesn't launch. So this part of it:

this.gridApi = params.api;

Hasn't been run. Therefore: gridApi remains 'undefined'.
So when I try to refresh the grid using the following method:

this.gridApi.refreshCells(params);

I get this error:

ERROR TypeError: Cannot read property 'refreshCells' of undefined

The grid does display the correct values:
enter image description here
But, it simply doesn't refresh because of this line as I said:

 return(this.chosenListsWithRowIndexes[params.data.chdCol][0]

My question is:
Why does that particular line make the grid unable to launch the GridReady event?

Ahmed Ghrib
  • 695
  • 4
  • 13
  • 29
  • You have asked so many ag-grid questions but they are all annoying to answer, because you don't include a demo/test case showing the problem. To make one, you can start from any example in [the documentation](https://www.ag-grid.com/documentation-main/documentation.php), such as [this one](https://plnkr.co/edit/BdfaOHKhzKQpHY5WFojL?p=preview). – thirtydot May 13 '19 at 22:31
  • @thirtydot Okay sorry. I tried to explain them as clearly as possible. If that's not enough I will take your advice – Ahmed Ghrib May 14 '19 at 07:01

0 Answers0