From f1ab8c56026890d522fbf2293f03cea68f9470c1 Mon Sep 17 00:00:00 2001 From: RomanTsukanov Date: Tue, 21 Nov 2023 10:45:44 +0400 Subject: [PATCH] Describe the `notify` method (#7335) * Describe the `notify` method * Add an illustration --- src/survey.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/survey.ts b/src/survey.ts index 3d84622104..835b964b1e 100644 --- a/src/survey.ts +++ b/src/survey.ts @@ -1178,6 +1178,8 @@ export class SurveyModel extends SurveyElementCore * * - `"advanced"`\ * An advanced header view applies the same properties as the basic view, plus [header settings](https://surveyjs.io/form-library/documentation/api-reference/iheader) from the [survey theme](https://surveyjs.io/form-library/documentation/api-reference/itheme#header). The advanced view features a more flexible header layout, a capability to specify a background image, and other settings that give a more professional look to the survey header. + * + * [View Demo](https://surveyjs.io/form-library/examples/brand-your-survey-header/ (linkStyle)) */ @property({ onSet: (newValue, target: SurveyModel) => { @@ -3291,6 +3293,16 @@ export class SurveyModel extends SurveyElementCore this.notify(this.completedStateText, this.completedState, value === "error"); } } + /** + * Displays a toast notification with a specified message. + * + * Depending on the `type` argument, a survey can display the following notification types: + * + * ![Toast notification types in SurveyJS Form Library](https://surveyjs.io//Content/Images/docs/notification-types.png) + * @param message A message to display. + * @param type A notification type: `"info"` (default), `"success"`, or `"error"`. + * @param showActions For internal use. + */ public notify(message: string, type: string, showActions: boolean = false): void { this.notifier.showActions = showActions; this.notifier.notify(message, type, showActions);