注:以下为10.0版本文档参考
I. FR.Msg
FR has a built-in unified style message box instead of alert, confirm and prompt in Window.
II. FR.Msg.alert method
1. How to use
FR.Msg.alert(title, message, callback) , an alert box pops up.
title: the title of the dialog box; message: the details of the prompt displayed in the dialog box; callback: the method called when OK is clicked.
Note: callback is a function method, so it must be a method when writing callback.
2. Effects
For example, if you add an editing end event to a control, JS is: FR.Msg.alert("Warning", "Wrong Value "); After the editing of the control is finished, you will see the dialog box as shown below:

III. FR.Msg.confirm method
1. How to use
FR.Msg.confirm(title, message, callback, min_width) , pops up a dialog with confirm and cancel buttons.
title: the title of the dialog box; message: the details of the prompt displayed in the dialog box; callback: the method called when OK is clicked, and a parameter of the return value is obtained; min_width: indicates the minimum width.
2. Effects
If a click event is added to a delete button, the JS is: FR.Msg.confirm("Warning", "Are you sure you want to delete?"); , you will see it when you click the delete row, and you will see the following image Dialog:

Clicking OK will return true, clicking Cancel will return false, which can be obtained in the callback, but cannot be obtained directly through the function result. For example, different operations are performed through JS code to control the return value.
A warning prompt box will pop up, click OK and it will pop up

Click Cancel to pop up

Note: You can also use the difference in the return value of confirm in Window to perform the following operations. For details, see JS implements double confirmation when deletingchapter.
IV. FR.Msg.prompt method
1. How to use
FR.Msg.prompt(title, message, value, callback, min_width) , a dialog that can pass parameters
title: the title of the dialog box;
message: the details of the prompt displayed in the dialog box;
callback: the method called when OK is clicked;
Value: the default value passed by the parameter;
min_width: the minimum width.
2. Effects
If a click event is added to a control, the JS is: FR.Msg.prompt("Enter","Hobby","Sports"); , when the control is clicked, you will see the dialog box shown below:
Note: This is just an example, the specific application can be viewed belowAssign other values to the radio button groupmethod of use in .
V. FR.Msg.toast method
1. How to use
FR.Msg.toast(message) , the long bar information that pops up from the upper right corner of the page.
message: pop-up message
2. Effects
For example, if you add a successful reporting event to a template, the JS is: FR.Msg.toast("Success"); After clicking the submit button, you will see the following dialog box pop up in the upper right corner of the page after the submission is successful:

注:以下为11.0版本文档参考
Msg.alert
| Method | FR.Msg.alert(title, message, callback) | Pop up message box with only OK button |
|---|---|---|
| Parameter | title: String message: String callback: function | title: the title of the alert box message: the prompt content displayed in the warning box callback: function method called when OK is clicked |
| Return value | void | |
| Example | A message box with the title Warning and the content Wrong Value pops up: A message box with the title Warning and the content Wrong Value pops up, click OK to clear the value of textEditor0 Text Widget: | |
| ro | Add theEditing End event to the Text Widget. When the length of the entered job number is not 6, a pop-up window will prompt: The job number must be 6 digits:
| |
| Mobile | Support mobile | |
Msg.confirm
| Method | FR.Msg.confirm(title, message, callback) | A message box with confirm and cancel buttons pops up. |
|---|---|---|
| Parameter | title: String message: String callback: function | title: dialog title message: the prompt content displayed in the dialog box callback: The method called when OK and Cancel are clicked, you can get a parameter value value:
Note: The value can only be obtained in the callback, and the result will not be obtained directly through FR.Msg.confirm(title, message, callback) |
| Return value | void | |
| Example | A message box with the title Warning and the content Are you sure you want to delete? pops up: A warning box with the title Warning and the content "Are you sure you want to delete?" pops up. When you click OK, "Delete Soon!" pops up; when you click Cancel, "Undelete!" pops up: | |
| Application example | Add a click event to a delete button . When clicking delete, confirm whether to delete it:
| |
| Mobile | Support mobile | |
Msg.prompt
| Method | FR.Msg.prompt(title, message, value, callback) | Pop up a message box that can post back content |
|---|---|---|
| Parameter | title: String message: String callback: function Value: String | title: the title of the dialog box |
| Return value | void | |
| Example | A message box with the title Enter and the content Hobbypops up: A message box with the title of Enter, the content of Hobby and the default input hobby of Sports will pop up: A message box with the title of Enter, the content of Hobbyand the default input hobby of Sports will pop up: The title of the pop-up is Enter, the content is Hobby, and the default value is no value. After entering the value, it is passed to thetextEditor0 text box widget: | |
| Application example | Add a State Chang event to the Radio Button, when Other is selected, a message box will pop up, enter other sports items and backfill them into the cell:
| |
| Mobile | Support mobile | |
Msg.toast
| Method | FR.Msg.toast(message) | The report pops up a long message box from the upper right corner of the page |
|---|---|---|
| Parameter | message: String | message: the content of the message box |
| Return value | void | |
| Example | A long bar message with the content "Export Successful" pops up: FR.Msg.toast("Export Successful"); | |
| Application example | Add an After Exporting Excel event to the page. After exporting Excel, Export Successful pops up in the upper right corner of the page:
| |
| Mobile | Support mobile | |