We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

grid.getPersistData() fails when there is a pagerTemplate

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


4 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team February 8, 2019 03:56 AM

Hi Vicent, 

Greetings from Syncfusion. 

We have validated the provided information and checked with our end. We are able to reproduce the reported problem so we confirmed “Need to exclude template from pageSettings while get persist data in Grid” as a defect and logged a report for the same. We will include the defect fix in our February 27, 2019 patch release. 

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link. 
 
Regards, 
Thavasianand S. 



TS Thavasianand Sankaranarayanan Syncfusion Team February 28, 2019 07:35 AM

Hi Vicent, 
 
Sorry for the inconvenience caused. 
  
Due to some complexity facing we are unable to include the fix in the February 27th Patch release. The fix for the issue “Need to exclude template from pageSettings while get persist data in Grid” and it will be included in our next patch release on March 6th , 2019.   
  
Until then we appreciate your patience.  
 
Regards, 
Thavasianand S. 



TS Thavasianand Sankaranarayanan Syncfusion Team March 7, 2019 06:53 AM

Hi Vicent, 
 
We are really sorry for the inconvenience caused. 
  
When we fixing this we are facing some other functionality issue due to this complexity we are unable to include this in March 6th, 2019 patch release. So, we will include this fix for the issue “Need to exclude template from pageSettings while get persist data in Grid” in our Essential Studio Volume 1 beta release which rolled in next week of March, 2019. 
  
Until then we appreciate your patience.  
 
Regards, 
Thavasianand S. 



TS Thavasianand Sankaranarayanan Syncfusion Team March 14, 2019 01:10 AM

Hi Vicent, 
Thanks for your patience. 
We are glad to announce that our Essential JavaScript 2 Volume 1 beta release (17.1.32) has been rolled out successfully and in that release, we have added the fix for the issue Need to exclude template from pageSettings while get persist data in Grid. 
 
Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon