function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Roshan singh 21Roshan singh 21 

Hi How to show Group and product Name and add quantity for all same product in lightning component

Hi I need to show a group of product name as a single name on the lighting page and add quantity for all product 
Example: 
SubscriptionProduct NameQuantity Subscription Details
SUB-0000001    ABC2 abc product Details 1
SUB-0000002   ABC5 abc product Details 2
SUB-0000003   ABC3 abc product Details 3
SUB-0000004   XYZ4 xyz product Details 1
SUB-0000005   ZYZ5 xyz product Details 2
SUB-0000006   ZYZ2 xyz product Details 3

But I need to show like this
Product NameQuantity  Subscription Details
   ABC 10 
   XYZ 11 

Please help me with how I can get this.
I am new to lightning.

Thanks in advance

 
AnudeepAnudeep (Salesforce Developers) 
As far as I know, lightning datatable or LWC datatable does not support grouping by default. However, I have seen code samples like the one below that shows grouping could be possible
 
<lightning:datatable aura:id="datatable" data="{!v.group.data}" columns="{!v.group.columns}" keyField="id"
                    onrowaction="{!c.handleRowAction}" hideCheckboxColumn="true" resizeColumnDisabled="true"
                    enableInfiniteLoading="{!v.enableInfiniteLoading}" loadMoreOffset="{!v.loadMoreOffset}" onloadmore="{!c.toggleAccordion}" />

There is an open question around this on SFSE as well