Skip to Content
0

Display columns of exapnded entity in smart table

May 08, 2017 at 09:02 AM

150

avatar image
Former Member

I am using a smart table and want to display columns from two entities which are linked through association.

In the smart table I have set the entity set of the main entity:

entitySet="TechnicalObjectSet"

and I have added the following code:

onBeforeRebind: function(oEvent) {
var mBindingParams = oEvent.getParameter("bindingParams");
    mBindingParams.parameters["expand"] = "EquipmentCharacteristicsSet";
},

which triggers on "beforeRebindTable" table's event.

In the gateway it calls the getExpandedEntitySet fine and fetches all the data but in the smart table I can only see columns that are coming from the first entity which is set using the entitySet parameter. How can I display columns from the second entity as well?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Jamie Cawley
May 08, 2017 at 03:42 PM
1

You can add a custom column to show the value as shown at

https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.ui.comp.sample.smarttable.mtableCustom/preview

Should be something like

<Table>
<columns>
<Column width="100px" hAlign="Left">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "Navpath/Column", "maxLength": "5","columnIndex":"4", "leadingProperty": "Navpath/Column"}' />
</customData>
<Text text="Column" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{Navpath/Column}" />
</cells>
</ColumnListItem>
</items>
</Table>

Regards,

Jamie

SAP - Technology RIG

Share
10 |10000 characters needed characters left characters exceeded