+ Start a Discussion
Jayesh Babu A VJayesh Babu A V 

is it possible to create a table with grouped items?

I want to create a table with grouped items. Below is the image:
User-added image
As, you can see from the image, in the abovr table, some items are grouped together. Is it possible to do this using datatable? I tried this using <aura:iteration>. But, I couldnt find a way to group the items. According to the logic that I have in my mind, i need a way to compare the previous item with the current item in iteration. Somebody, please help.
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

Anudeep