# (this give me list eg : ,s, s, m ...
list = list + "," + name
Run Code Online (Sandbox Code Playgroud)
我想使用拆分然后加入...尝试使用下面..我不知道我在做什么
list = list.split(',') + name + collect{|c| c.name}.to_sentence
list = list.split(',') + name + collect{|c| c.name}.Join(",")
Run Code Online (Sandbox Code Playgroud)
有任何想法吗??
我正在玩OData服务,我很困惑何时使用它
var oModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/V3/(S(k42qhed3hw4zgjxfnhivnmes))/OData/OData.svc");
this.getView().setModel(oModel);
Run Code Online (Sandbox Code Playgroud)
VS
var oModel = new sap.ui.model.odata.ODataModel("odatserviceurl", true);
var productsModel = new JSONModel();
oModel.read("/Products",
null,
null,
false,
function _OnSuccess(oData, response) {
var data = { "ProductCollection" : oData.results };
productsModel.setData(data);
},
function _OnError(error) {
console.log(error);
}
);
this.getView().setModel(productsModel);
Run Code Online (Sandbox Code Playgroud)
我有两个使用这两种方法的工作示例,但我无法弄清楚为什么使用read方法,如果我可以实现与第一个版本相同.请向我解释或指导可以解决我的困惑的文件.