好的,我知道你要做什么,但是如果你想让它符合FIORI的指导方针,这里是你需要做的:
-
添加到表格模式中:“singleselect”:
<Table id="idProductsTable" mode="SingleSelect" inset="false" items="
路径:'ordermodel>/txn_orddtls'“>
-
从表格中删除按钮
-
在表格工具栏中重新创建按钮
-
将方法更改为:
editCartItemPressed: function(){
var oItem= this.getView().byId("idProductsTable").getSelectedItem();
var oEntry = oItem.getBindingContext("yourODataModel").getObject();
console.log(oEntry.Quantity); //your quantity you want to update
//yourODataModel.update(oItem.getBindingContextPath(), oEntry, {
// success: function(){}, // your success handler
// error: function(){} // your error handler
//});
},
结果:
你有一张带有单选按钮的桌子。通过这些选项,您可以选择一行并通过表格工具栏中的按钮编辑/删除。
我建议您在创建应用程序之前检查FIORI设计指南,如果您不确定如何实现所需的结果,请在以下位置检查样本:
https://sapui5.hana.ondemand.com/1.54.8/#/controls