Skip to Content
avatar image
Former Member

Display columns of exapnded entity in smart table

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 08, 2017 at 03:42 PM

    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

    Add comment
    10|10000 characters needed characters exceeded