1
votes

On ag-Grid documentation, there is mentioned a lot about this GridOptions interface.

Grid Properties, Grid Events, Grid Callbacks, all 'claim' that

this options are available through the GridOptions interface

I managed to access, for example, the columnDefs property without any 'usage' of this gridOptions, by the following:

.html

<ag-grid-angular 
            style="margin: auto;
            width: 80%; height: 70%;
            #agGrid
            class="ag-theme-material"
            [rowData]="rowData" 
            [columnDefs]="columnDefs"
            >
</ag-grid-angular>

.ts

private columnDefs;

constructor() {
    this.columnDefs = ...; // columns array
   }

However, I came to a point where i don't know how to integrate certain features without calling this gridOptions, like accessing row nodes provided by the api.

How can i mention / reach to this gridOptions?

1

1 Answers

2
votes

to Mention gridOptions in your HTML put the below code

 [gridOptions]="gridOptions"

and in your Component.ts

public gridOptions: GridOptions;

on ngonINIT

this.gridOptions.columnDefs=this.columnDefs;

Then you can access this gridoptions anywhere in the code.