ODataModel传递"expand"读取参数 [英] ODataModel passing "expand" parameter in read
本文介绍了ODataModel传递"expand"读取参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将扩展参数传递给 read
,因为如果我这样调用该服务将不起作用:
I'd like to pass expand parameters to read
because it doesn't work if I call the service like this:
oModel1.read("/LinesSet?$expand=ToCells", {
推荐答案
The read
API expects a map of options as a second argument in which we can define any query using the property urlParameters
:
oModel1.read("/LinesSet", {
urlParameters: {
"$expand": "ToCells"
},
success: this.onSuccess.bind(this),
// ...
});
urlParameters:包含将作为查询字符串传递的参数的映射
urlParameters: A map containing the parameters that will be passed as query strings
请不要忘记在expand
之前加入$
来表明这是一个系统查询.否则,它将被计为自定义查询.
Just don't forget to include $
before expand
to indicate that it's a system query. Otherwise, it will be counted as a custom query.
这篇关于ODataModel传递"expand"读取参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文