ODataModel在read中传递“expand”参数

时间:2017-04-06 12:42:17

标签: odata sapui5

我想将展开参数传递给read,因为如果我像这样调用服务它不起作用:

oModel1.read("/LinesSet?$expand=ToCells", {

1 个答案:

答案 0 :(得分:3)

read API expects a map of options作为第二个参数,我们可以使用属性urlParameters定义任何查询:

oModel1.read("/LinesSet", {
    urlParameters: {
        "$expand": "ToCells"
    },
    success: this.onSuccess.bind(this),
    // ...
});
  

urlParameters:包含将作为查询字符串传递的参数的地图

不要忘记在$之前添加expand来表明它是系统查询。否则,它将被计为自定义查询

相关问题