2016-09-19 37 views

回答

0

我認爲這並不是註定要隱藏其中一個按鈕,但您可以使用解決方法解決此問題。

在你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「+」 - 取消按鈕「

希望它有幫助,關於我的答案的問題,請在下面添加註釋。

相關問題