0

I am using custom pagination control. To initialize the control I am calling gridOptions.api.paginationGetPageSize() and gridOptions.api.paginationGetRowCount(). I tried calling the two api methods on onPaginationChanged and onGridReady, everytime I get the error

Cannot read property 'api' of undefined

Any ideas why. I am using md-paginator (angular material 2 control) for paging.

Maverik
  • 411
  • 4
  • 22
  • My ag-grid is located inside child component, as I am using tabs (tabs are the child components.). How do I know if child component is initialized? – Maverik Sep 01 '17 at 13:16

1 Answers1

-1

One possibility is that your view cannot find and initialize your grid in the component.

Have you tried the following:

<ag-grid-angular *ngIf="gridOptions != null" ...
Alexander Zbinden
  • 2,315
  • 1
  • 17
  • 21