Scenario
做一個table binding,consume oData service。
Root entity set是ProductSet。ProductSet又有2個navigation properties: "ToSupplier" + "ToSalesOrderLineItems"。
通過如下代碼,可以成功展開supplier的信息。
<Table id="WLtable" items="{ path: '/ProductSet', sorter: { path: 'ProductID', descending: false }, parameters: { expand: 'ToSupplier' } }">
問題:如何同時展開supplier和salesOrderLineItems信息
Solution
使用如下寫法:
expand: "ToSupplier,ToSalesOrderLineItems"
如果 "ToSupplier" 是 "ToSalesOrderLineItems"的parent,那么應(yīng)該這么寫:
expand: "ToSupplier/ToSalesOrderLineItems"