Sapui5 如何在ui5中重置customData值?

Sapui5 如何在ui5中重置customData值?,sapui5,Sapui5,我想在单击按钮时更改customData值,我可以使用oEvent.getSource.datakey获取该值,但如何重置它 oEvent.getSource.data.key=1 上述代码不起作用删除自定义数据 oEvent.getSource.datakey,null;//或 oEvent.getSource.RemoveCustomDataId; 或删除所有: oEvent.getSource.datanull;//或 oEvent.getSource.CustomData; 添加或修改自

我想在单击按钮时更改customData值,我可以使用oEvent.getSource.datakey获取该值,但如何重置它

oEvent.getSource.data.key=1

上述代码不起作用

删除自定义数据 oEvent.getSource.datakey,null;//或 oEvent.getSource.RemoveCustomDataId; 或删除所有:

oEvent.getSource.datanull;//或 oEvent.getSource.CustomData; 添加或修改自定义数据 oEvent.getSource.datakey,数据;//或 oEvent.getSource.addCustomDatanew CustomData{//sap/ui/core/CustomData中需要 钥匙:钥匙, 值:数据 }; 看

顺便说一句:不建议像使用oSource.data.key那样访问属性。您应该始终使用getter/setter。

删除自定义数据 oEvent.getSource.datakey,null;//或 oEvent.getSource.RemoveCustomDataId; 或删除所有:

oEvent.getSource.datanull;//或 oEvent.getSource.CustomData; 添加或修改自定义数据 oEvent.getSource.datakey,数据;//或 oEvent.getSource.addCustomDatanew CustomData{//sap/ui/core/CustomData中需要 钥匙:钥匙, 值:数据 }; 看

顺便说一句:不建议像使用oSource.data.key那样访问属性。您应该始终使用getter/setter