cancel
Showing results for 
Search instead for 
Did you mean: 

Grouping data in Smart Table

nikeshtt
Advisor
Advisor
0 Kudos
5,691
Hey can anyone tell me how to group data in sap.ui.comp.smarttable ?

<smarttable:SmartTable id="fileTableId" header="{i18n>tableTitle}" useTablePersonalisation="true" entitySet="SourceData"
            enableAutoBinding="false" beforeRebindTable="onRebindSourceTable" tableType="ResponsiveTable" showRowCount="true" demandPopin="false"
            class="sapUiSmallMarginBeginEnd" ignoreFromPersonalisation="BusinessUnit"
            customData:p13nDialogSettings="{group:{visible:false},filter:{visible:false}}"
            requestAtLeastFields="Id,Name,Address "
            initiallyVisibleFields=" Id,Name,Address " useExportToExcel="false">
            <smarttable:customToolbar>
                <OverflowToolbar design="Transparent">
                    <ToolbarSpacer/>
                    <Button id="idDownloadTemp" text="{i18n>downloadBut}" tooltip="{i18n>downloadBut}" press="handleDownloadPress"/>
                    <Button id="idUploadExcel" text="{i18n>uploadExcelBut}" tooltip="{i18n>uploadExcelBut}" press="onUploadOpen"/>
                    <Button id="idDeleteFile" icon="sap-icon://delete" tooltip="{i18n>deleteFile}" press="onDeleteFile" enabled="false"/>
                    <Button id="idRefresh" tooltip="{i18n>refresh}" press="onReload" icon="sap-icon://refresh"/>
                </OverflowToolbar>
            </smarttable:customToolbar>
            <Table id="table" growing="true" growingScrollToLoad="true" updateFinished="onUpdateFinished" mode="MultiSelect"
                selectionChange="onTableSelectionChange">

Accepted Solutions (0)

Answers (2)

Answers (2)

ibibhu
Product and Topic Expert
Product and Topic Expert

Hi Nikesh T T,

In this scenario as you have your own table and I guess you might have defined the columns as well. "mergeDuplicates="true"

<smarttable:SmartTable><Tableid="table" growing="true" growingScrollToLoad="true" updateFinished="onUpdateFinished" mode="MultiSelect"selectionChange="onTableSelectionChange"><columns> <Column mergeDuplicates="true">
  <Label design="Bold" text="Item"/>
 </Column></columns>
<item><ColumnListItem vAlign="Middle"> <cells>
  <Text text="{Details}"/> </cells></ColumnListItem>										</items>
<Table></smarttable:SmartTable


Thanks and Regards,
Bibhu

maheshpalavalli
Active Contributor

Hi Nikesh T T

You have to create an annotation file and provide sort and groupby annotations to your entityset. For more info, check this blog:

https://blogs.sap.com/2018/01/11/fiori-elements-list-report-sorting-grouping-and-table-types/

BR,

Mahesh

0 Kudos

Hi nikeshtt thank you for very good Blog. Unfortunately still it is not working for me after adding GroupBy to Annotations.

 <Annotation Term="UI.PresentationVariant">
                    <Record Type="UI.PresentationVariantType">
                        <PropertyValue Property="GroupBy">
                            <Collection>
                                <PropertyPath>Category</PropertyPath>
                            </Collection>
                        </PropertyValue>

ibibhu
Product and Topic Expert
Product and Topic Expert
0 Kudos
  • GroupBy is only evaluated for the AnalyticalTable control.

    UI5 Reference