showModal(params: Object)
Requires:
BaseKit≥2.0.1@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
Description
Show a modal dialog
Parameters
| Property | Type | Required | Default | Description | BaseKit Since |
|---|---|---|---|---|---|
title | string | Yes | - | Title | - |
content | string | No | - | Content | - |
showCancel | boolean | No | true | Whether to show a cancel button | - |
cancelText | string | No | "cancel" | Text of the cancel button, up to 4 characters | - |
cancelColor | string | No | - | Cancel button text color, must be a hexadecimal color string | - |
confirmText | string | No | "confirm" | Text of the confirm button, up to 4 characters | - |
confirmColor | string | No | - | Confirm button text color, must be a hexadecimal color string | - |
isShowGlobal | boolean | No | false | Whether it's a global dialog; if so, it appears on top | v3.14.3 |
modalStyle | 0 | 1 | No | 0 | Dialog style | v3.21.2 |
| No | - | Dialog input field properties | v3.21.2 | ||
complete | () => void | No | - | Completion callback (executed on both success and failure) | - |
success | (params: Object) => void | No | - | Callback on successful API call | - |
fail | (params: Object) => void | No | - | Failure callback | - |
success callback parameters
| Property | Type | Description | BaseKit Since |
|---|---|---|---|
confirm | boolean | true indicates the user tapped the confirm button | v3.2.6 |
cancel | boolean | true indicates the user tapped Cancel (used on Android to distinguish mask tap from cancel button) | v3.2.6 |
inputContent | string | Input value | v3.21.2 |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None
Valid Values
modalStyle
| Value | Description | BaseKit Since |
|---|---|---|
0 | Default style | v3.21.2 |
1 | Input style | v3.21.2 |