I am Using Smart Table. i want to know the following regarding this,
To build columns automatically from Service use smart table.
1.How Make some columns visible by default?
To get initial column you need specific annotation called LineItem. The fields under this will automatically built by smart.
How can we inject our own columns into smart table, like if we want to display the icon based on the gender(male or female).
How can we set aggregated columns like Name (FirstName + LastName).
How to define the sorting and filtering on Aggregated Columns.
Answers to all of this would be build your sap.m.Table and wrap it inside the smart table. By using this the columns built by you will you have custom coded functionality and column built by smart table (for other fields in service)
XML View
<core:View xmlns:core="sap.ui.core" xmlns="sap.m" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar" xmlns:smartTable="sap.ui.comp.smarttable" controllerName="smartTable.controller" class="sapUiSizeCompact">
<Page id="page" title="Customer Line Items">
<smartTable:SmartTable entitySet="Patient" tableType="ResponsiveTable" useExportToExcel="true" useVariantManagement="true" useTablePersonalisation="true" header="Line Items" showRowCount="true" persistencyKey="SmartTableAnalytical1" enableAutoBinding="true">
<Table>
<columns>
<Column>
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "PatientId","leadingProperty": ["LastName", "FirstName"],"sortProperty": "LastName","filterProperty": "LastName"}'/>
</customData>
<Label text="Concatenated Name" />
</Column>
<Column>
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "Status","leadingProperty": "Status","sortProperty": "Status","filterProperty": "Status"}'/>
</customData>
<Label text="Status" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<ObjectIdentifier title="{LastName} {FirstName}"/>
<Text text="{Status}"/>
</cells>
</ColumnListItem>
</items>
</Table>
</smartTable:SmartTable>
</Page>
</core:View>
Controller In Controller you have to set the odata model to the view or smartTable.