openAlertDialog

显示包含消息和按钮的警报对话框。

适用于

模型驱动应用

Syntax

context.navigation.openAlertDialog(alertStrings, options)

参数

参数名称 类型 必选 Description
alertStrings AlertDialogStrings 是的 要用于警报对话框的字符串。 AlertDialogStrings 具有以下属性:
- textstring. 要显示在警报对话框中的消息。
- confirmButtonLabelstring. 确认按钮标签。 如果未指定按钮标签, 则确定 (以用户的首选语言)用作按钮标签。
options AlertDialogOptions 是的 对话框选项。 AlertDialogOptions 具有以下属性:
- heightnumber. 警报对话框的高度(以像素为单位)。
- widthnumber. 警报对话框的宽度(以像素为单位)

返回值

类型: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 组件框架概述