共用方式為


openAlert對話框

顯示包含訊息和按鈕的警示對話方塊。

適用於

模型導向應用程式

語法

context.navigation.openAlertDialog(alertStrings, options)

參數

參數名稱 類型 為必填項目 Description
警示字串 AlertDialogStrings Yes 要在警示對話方塊中使用的字串。 AlertDialogStrings 具有下列屬性:
- 文字string。 要在警示對話方塊中顯示的訊息。
- confirmButtonLabelstring。 確認按鈕標籤。 如果您未指定按鈕標籤,則會使用 OK (使用者慣用的語言) 作為按鈕標籤。
options AlertDialogOptions Yes 對話方塊選項。 AlertDialogOptions 具有下列屬性:
- 身高number。 警示對話方塊的高度 (以像素為單位)。
- 寬度number。 警示對話方塊的寬度 (以像素為單位)

傳回值

類型: Promise

備註

參見 承諾文件

Example

context.navigation.openAlertDialog({text:"This is an alert.", confirmButtonLabel : "Yes",}).then(
      function success()
      {
         document.getElementById("openAlertDialogButton")!.innerHTML = "Alert dialog closed";
      },
      function()
      {
         document.getElementById("openAlertDialogButton")!.innerHTML = "Error in Alert Dialog";
      }
   );

導覽
Power Apps 元件架構 API 參考
Power Apps 元件架構概觀