本地作用域對象如何作爲參數傳遞到格式化程序函數中。我只知道如何將綁定值傳遞給格式化函數,但我需要將本地範圍的其他對象傳遞給格式化函數。SAPUI5本地作用域對象作爲格式化程序函數參數
// request the order operations and bind them to the operation list
oView.getModel().read(sPath + "/OperationSet", {
success: function (oData, oResponse) {
if (oData && oData.results) {
var oOrder = oView.getBindingContext().getObject();
// I need sOrderType inside the external formatter function
var sOrderType = oOrder.OrderType;
operationList.bindAggregation("items", {
path: sPath + "/OperationSet",
template: new sap.m.StandardListItem({
title: "{Description}",
info: "{DurationNormal} {DurationNormalUnit}",
visible: {
parts: [{path: 'Activity'}],
formatter: de.example.util.Formatter.myFormatterFunction
}
}),
filters: []
});
}
},
error: function (oData) {
jQuery.sap.log.error("Could not read order operations");
}
});
oMyObject是恆定的,與綁定值無關嗎? –
沒有oMyObject與其他視圖信息一起創建。 –