-3
我只需要在View Setting對話框中顯示「OK」按鈕。可能嗎?我該怎麼辦?如何在視圖設置對話框中隱藏「取消」按鈕?
我只需要在View Setting對話框中顯示「OK」按鈕。可能嗎?我該怎麼辦?如何在視圖設置對話框中隱藏「取消」按鈕?
我認爲這並不是註定要隱藏其中一個按鈕,但您可以使用解決方法解決此問題。
在你getDialog功能設置按鈕的可見屬性設置爲false
_getDialog : function() {
if (!this._oDialog) {
this._oDialog = sap.ui.xmlfragment("sap.m.sample.ViewSettingsDialog.Dialog", this);
this.getView().addDependent(this._oDialog);
this._oDialog._dialog.mAggregations.endButton.setVisible(false); //set cancel button invisible
}
return this._oDialog;
},
handleOpenDialog: function() {
this._getDialog().open();
}
您可以用id或通過對話框對象直接訪問按鈕做到這一點:直接 :
this._oDialog._dialog.mAggregations.endButton.setVisible(false); // assuming your dialog was initiated with: this._oDialog
With Id:
sap.ui.getCore().byId("Your_View_Dialog_ID-cancelbutton").setVisible(false);
取消按鈕ID consi你的「viewsettingsdialog-id」的ID「+」 - 取消按鈕「
希望它有幫助,關於我的答案的問題,請在下面添加註釋。
你有什麼具體問題嗎?請展示你的一些工作。 – Ted