on 11-04-2020 9:23 AM
Hello Friends
can anyone help with binding the Expand entity to smart table
View and Controller Code
<smartTable:SmartTable id="smartIdid" entitySet="" tableType="ResponsiveTable" useExportToExcel="true" useTablePersonalisation="true" showRowCount="true" showFullScreenButton="false" enableAutoBinding="true" showVariantManagement="true" width="100%" header="Price Book Operations" beforeRebindTable="onBeforeRebindTable" > <Table id="dataTable" selectionChange="onSelectItem1" sticky="ColumnHeaders,HeaderToolbar"> <columns> <Column> <customData> <core:CustomData key="p13nData" value='{"columnKey": "ValuesSet","leadingProperty": "ValuesSet"}'/> </customData> <Text text="Product Id"/> </Column> </columns> <items> <ColumnListItem type="Navigation" press="onSelectPriceGroup"> <cells > <Text text="{ValuesSet/name}"/> <!--<Link text="{position}" press="onpresspbno"/>--> </cells> </ColumnListItem> </items> </Table> </smartTable:SmartTable>
Controller Code
onAfterRendering:function(){
this.Path="TableSet?$filter=tablename eq 'Mara'"; //main entity in the odata service
sap.ui.getCore().byId('smartIdid').setEntitySet(this.Path);
sap.ui.getCore().byId('smartIdid').rebindTable();
}
onBeforeRebindTable: function (oEvent) {
var mBindingParams = oEvent.getParameter("bindingParams");
mBindingParams.parameters["expand"] = "ValuesSet"; // Expand entity under main entity , data under expand entity changes based on the filter we provide in the main entity , we should bind the data in expand entity to smart table
},
hi venkatesh,
You can check the below answer
https://stackoverflow.com/questions/32068154/sapui5-how-to-bind-smart-table
You need to use tablebindingpath to pass the expand entity
Regards,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://ui5.sap.com/#/api/sap.ui.comp.smarttable.SmartTable%23methods/setInitiallyVisibleFields
User | Count |
---|---|
72 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.