我有单元哦sap.m.Button在新闻发布会上我想知道哪个单元格和行没有点击按钮可以帮助我。
答案 0 :(得分:3)
答案 1 :(得分:2)
//查看
<Table cellClick="onPress"></Table>
//控制器
onPress : function(oEvent) {
this.showObject(oEvent.getParameters());
},
showObject : function(oParameters) {
yourTableObject = ..... 2 do
var rowIndex = oParameters.rowIndex;
var colIndex = oParameters.columnIndex;
var sPath = yourTableObject.getContextByIndex(rowIndex).sPath;
var oDataSelect = yourTableObject.getContextByIndex(rowIndex).oModel.getProperty(sPath);
}
如果你想点击图标,那就是
onPressYourIcon : function(oEvent) {
var oItem = oEvent.getSource(); // <-- this is what you Need, the clicked item
var sPath = oItem.getBindingContext().sPath;
}