我正在尝试使用 SAPUI5 在表上实现行选择事件,并编写以下代码:
var oModel = new sap.ui.model.odata.ODataModel( "../path.xsodata",true);
sap.ui.getCore().setModel(oModel);
oTable.bindRows({path:"/path", formatter:function(fValue) {
jQuery.sap.require("sap.ui.core.format.DateFormat");
var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "dd.MM.yy"});
return oDateFormat.format(new Date(fValue));
} }).placeAt("table");
oTable.attachRowSelect(function(oEvent){
var currentRowContext = oEvent.getParameter("rowContext");
var first_value= oSystemDetailsML.getProperty("firstvalue", currentRowContext);
//var second_value= oSystemDetailsML.getProperty("secondvalue", currentRowContext);
});
当我执行代码时,浏览器中出现错误"Uncaught TypeError: Object [object Object] has no method 'attachRowSelect'"
。问题出在哪里的任何想法。对我来说,在参考“ http://scn.sap.com/thread/3452412 ”和“ http://scn.sap.com/community/developer-center/front-end/blog/2012/06 ”后应该可以正常工作/01/sample-application-using-ui5-and-gateway ´。
谢谢