我在应用程序中添加了一个与数据绑定的表。该表正确显示了初始设置的数据。但是,当在应用程序的不同部分更改signEnabled
模型中PropertyButton
的值以更改关联按钮的启用/禁用状态时,此按钮不会更新,它保持禁用状态,因为以前。成功更新表的解决方案是什么?预先感谢!
代码如下:
var oTable = this.getView().byId("tableSignDocuments");
oTable.setModel(jsonmodel);
oTable.bindColumns("/columns", function(sId, oContext) {
var columnName = oContext.getObject().value;
var canSign = oContext.getObject().isBP;
var isSalesman = oContext.getObject().isSalesman;
var type = oContext.getObject().label;
var signButtonEnabled = _this.getView().getModel("PropertyButton").getData().signEnabled;
return new sap.ui.table.Column({
multiLabels: [
new sap.ui.commons.Label({text: columnName}),
(canSign === true) ?
new sap.m.Button({
text: "Sign",
enabled: signButtonEnabled,
press: function(evt) {
var signingProperties = {
idSigner: sap.ui.getCore().getModel("headerCore").getData().idDossier,
docsToSign: _this.getView().getModel("DocumentNumberSelected").getData().ids,
type: type,
};
DigitalUtils.sign(signingProperties, isSalesman);
},
width: "80px"
}) :
new sap.ui.commons.Label({text: ""})
],
template: columnName,
hAlign: "Center"
});
});