Unable to get Sub totals in FooterTemplate

Hi

I have ej2-angular-grid version - 18.4.49. Our Angular version is Angular 9.1.1.


and I am referring to your example link below to display the sub-totals using column header drag and drop.

https://ej2.syncfusion.com/angular/demos/?utm_source=npm&utm_campaign=grid#/material/grid/aggregate-group

The drag and drop works great but I am unable to get sub totals. No errors are also shown in DevTools. This is how it looks.

attached is the source code (html and .ts files). I have imported AggregateService, GroupService, GridComponents.

Please advise how best to get Sub totals for field = shiftPay (Header Text = Shift Pay)



Attachment: generictable.component_2811aeec.zip


1 Reply

PS Pavithra Subramaniyam Syncfusion Team April 1, 2022 04:17 PM UTC

Hi Mr J GEORGE,


Thanks for contacting Syncfusion support.


From your code, we understood that you want to show the Grid aggregates on a condition, and you have placed the ngIF in the “e-aggregates” tag which is the cause of the reported problem. To overcome this, we suggest using the ngIF in the “e-columns” tag instead of the aggregate tag. Please refer to the below code example and sample link for more information.


 

<e-aggregates>

  <e-aggregate>

    <e-columns *ngIf="showTotals">

      <e-column type="Sum" field="UnitsInStock">

        <ng-template #groupFooterTemplate let-data>

          Total Shift Pay: {{ data.Sum }}</ng-template>

      </e-column>

    </e-columns>

  </e-aggregate>

</e-aggregates>

 


Sample: https://stackblitz.com/edit/angular-4jyaut?file=app.component.html


Please get back to us if you need further assistance on this.


Regards,

Pavithra S


Loader.
Up arrow icon