Hello,
the grid is working fine until I set a template for the pager. Then I get the following error when I try to call grid.getPersistData() on the dataStateChange event handler:
UsuariosComponent.html:9 ERROR TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at GridComponent.push../node_modules/@syncfusion/ej2-base/src/component.js.Component.addOnPersist (component.js:271)
at GridComponent.push../node_modules/@syncfusion/ej2-grids/src/grid/base/grid.js.Grid.getPersistData (grid.js:374)
at UsuariosComponent.push../src/app/usuarios/usuarios.component.ts.UsuariosComponent.dataStateChange (usuarios.component.ts:66)
at Object.eval [as handleEvent] (UsuariosComponent.html:16)
at handleEvent (core.js:23008)
at callWithDebugContext (core.js:24078)
at Object.debugHandleEvent [as handleEvent] (core.js:23805)
at dispatchEvent (core.js:20457)
at core.js:21947
The grid is set this way:
<ejs-grid id="gridUsuarios"
enablePersistence="true"
isResponsive="true"
height="100%"
[dataSource]="dtoUsuarios$ | async"
allowSorting="true"
allowPaging="true"
(dataStateChange)="dataStateChange($event)"
(beforeDataBound)='beforeDataBound($event)'>
<e-columns>
<e-column field='Alias' headerText='Alias'></e-column>
<e-column field='Nombre' headerText='Nombre'></e-column>
<e-column field='MomentoUltimoLogin' headerText='Último login'></e-column>
<!--<e-column field='MomentoUltimoLogin' headerText='Último login' [format]="{ type: 'dateTime', format: 'yyyy/MM/dd hh:mm' }"></e-column>-->
</e-columns>
<ng-template #pagerTemplate let-datosPag>
<div style="display:block; height:45px; background-color:lightblue;">
<div>
<div><b>{{datosPag.currentPage}} of {{datosPag.totalPages}}</b></div>
<div>{{datosPag.totalRecordsCount}} items</div>
</div>
</div>
</ng-template>
</ejs-grid>
And everything works again if I remove the #pagerTemplate.
Is this a bug on the current version (EJ2 v16.4.52) or am I doing something wrong?
Thanks in advance