cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Binding expanded entityset result to smart table

Kishoregokara
Participant
0 Likes
2,062

Hello,

I am trying to bind an expanded entity set result to a smart table. Followed the below steps.

I tried giving the navigation property name in tableBindingPath property (as mentioned at link). But that's not working. So I defined custom columns(as mentioned at here and here) and tried binding the navigation property fields names. Also in beforeRebindTable I have mentioned the expand parameter as below

mBindingParams.parameters["expand"] = "HeaderToItemNav";

The second approach works and expanded entity call happens and pulls the data. But only the header set data is binding and not the dependent entity set details.

Please throw some light on how to achieve this.

<smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="HeaderSet">
                            <smartFilterBar:controlConfiguration>
                                <smartFilterBar:ControlConfiguration key="Id" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false">
                                </smartFilterBar:ControlConfiguration>
                            </smartFilterBar:controlConfiguration>
                        </smartFilterBar:SmartFilterBar>

                        <smartTable:SmartTable id="smartIdid" 
                                               entitySet="HeaderSet" 
                                               tableType="ResponsiveTable" 
                                               useExportToExcel="true" 
                                               useTablePersonalisation="true" 
                                               showRowCount="true" 
                                               showFullScreenButton="false" 
                                               enableAutoBinding="true" 
                                               showVariantManagement="true" 
                                               width="100%" header="Stocks" 
                                               beforeRebindTable="onBeforeRebind">
                            <Table id="dataTable">
                                <columns>
                                    <Column>
                                        <customData>
                                            <core:CustomData key="p13nData" 
                                                             value='{"columnKey": "Sdept","leadingProperty": "HeaderToItemNav/Sdept"}'/>
                                        </customData>
                                        <Text text="Department"/>
                                    </Column>
                                    <Column>
                                        <customData>
                                            <core:CustomData key="p13nData" 
                                                             value='{"columnKey": "Stock","leadingProperty": "HeaderToItemNav/Stock"}'/>
                                        </customData>
                                        <Text text="Stock"/>
                                    </Column>
                                </columns>
                                <items>
                                    <ColumnListItem>
                                        <cells >
                                            <Text text="{HeaderToItemNav/Sdept}"/>
                                        </cells>
                                        <cells >
                                            <Text text="{HeaderToItemNav/Stock}"/>
                                        </cells>
                                    </ColumnListItem>
                                </items>
                            </Table>
                        </smartTable:SmartTable>

Controller:

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

result-set.txt

Accepted Solutions (0)

Answers (1)

Answers (1)

GeethaRanjani
Advisor
Advisor
0 Likes

Did you get a solution to this?