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?

0 Answers