A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://surveyjs.io/form-library/documentation/api-reference/settings below:

settings | SurveyJS

Global settings that apply to all surveys on the page. To specify one of the settings, use the code below:

import { settings } from "survey-core";

settings.settingName = "value";

Specifies whether to animate survey elements.

Default value: true

Type:
boolean writable
Implemented in:
settings

Specifies how many milliseconds a survey should wait before it automatically switches to the next page. Applies only when auto-advance is enabled.

Default value: 300

Type:
number writable
Implemented in:
settings

An object that configures string comparison.

Nested properties:

Type:
{ trimStrings: boolean; caseSensitive: boolean; normalizeTextCallback: (str: string, reason: string) => string; } writable
Implemented in:
settings

A function that activates a proprietary SurveyJS confirmation dialog.

Use the following code to execute this function:

import { settings } from "survey-core";

settings.confirmActionAsync("Are you sure?", (confirmed) => {
  if (confirmed) {
    // ...
    // Proceed with the action
    // ...
  } else {
    // ...
    // Cancel the action
    // ...
  }
});

You can override the confirmActionAsync function if you want to display a custom dialog window asynchronously:

import { settings } from "survey-core";

async function confirmDialog(message) {
  return new Promise((resolve) => {
    // Implement an async dialog window here
  });
}

settings.confirmActionAsync = (message, callback) => {
  confirmDialog(message).then((result) => {
    callback(result);
  });
};
Type:
(message: string, callback: (res: boolean) => void, options?: IConfirmDialogOptions) => void writable
Implemented in:
settings

A function used to display a custom confirmation dialog.

This function is undefined by default. To enable a custom dialog, assign a function that returns true if the user confirms the action or false otherwise. For example, the following code uses the built-in window.confirm() method to open a confirmation dialog window:

import { settings } from "survey-core";

settings.confirmActionAsync = (message) => {
  return window.confirm(message);
};
Type:
(message: string) => boolean writable
Implemented in:
settings

An object that specifies icon replacements. Object keys are built-in icon names. To use a custom icon, assign its name to the key of the icon you want to replace:

import { settings } from "survey-core";

settings.customIcons["icon-redo"] = "custom-redo-icon";

For more information about icons in SurveyJS, refer to the following help topic: UI Icons.

Type:
{} writable
Implemented in:
settings

An object that configures survey appearance when the survey is being designed in Survey Creator.

Nested properties:

Type:
{ showEmptyDescriptions: boolean; showEmptyTitles: boolean; } writable
Implemented in:
settings

A value to save in survey results when respondents select the "Don't know" choice item.

Default value: "dontknow"

Type:
string writable
Implemented in:
settings

Specifies an action to perform when users press the Enter key within a survey.

Possible values:

Type:
"moveToNextEditor" | "loseFocus" | "default" writable
Implemented in:
settings

Specifies the direction in which to lay out Checkbox and Radio Button Group items. This setting affects the resulting UI when items are arranged in more than one column.

Possible values:

Type:
string writable
Implemented in:
settings

A separator used in a shorthand notation that specifies a value and display text for an ItemValue object: "value|text".

Default value: "|"

Type:
string writable
Implemented in:
settings
See also:
settings.choicesSeparator

An object that configures lazy rendering.

Nested properties:

View Demo

Type:
{ enabled: boolean; firstBatchSize: number; } writable
Implemented in:
settings
See also:
SurveyModel.lazyRenderEnabled

An object that contains properties related to localization.

Nested properties:

Type:
{ useLocalTimeZone: boolean; storeDuplicatedTranslations: boolean; defaultLocaleName: string; } writable
Implemented in:
settings

An object with properties that configure input masks.

Nested properties:

Type:
{ patternPlaceholderChar: string; patternEscapeChar: string; patternDefinitions: { [key: string]: RegExp; }; } writable
Implemented in:
settings

An object with properties that apply to Single-Choice, Multiple-Choice, and Dynamic Matrix questions.

Nested properties:

Type:
{ defaultCellType: string; defaultRowName: string; totalsSuffix: string; maxRowCount: number; maxRowCountInCondition: number; renderRemoveAsIcon: boolean; columnWidthsByType: { [index: string]: { minWidth?: string; width?: string; }; }; rateSize: "small" | "normal"; } writable
Implemented in:
settings

Specifies how many times surveys can re-evaluate expressions when a question value changes. This limit helps avoid recursions in expressions.

Default value: 10

Type:
number writable
Implemented in:
settings

Specifies a maximum date that users can enter into a Text question with inputType set to "date" or "datetime-local". Set this property to a string with the folllowing format: "yyyy-mm-dd".

Type:
string writable
Implemented in:
settings

A maximum width value for all survey elements.

Default value: "100%"

You can override this setting for individual elements: maxWidth.

Type:
string writable
Implemented in:
settings

Specifies a minimum date that users can enter into a Text question with inputType set to "date" or "datetime-local". Set this property to a string with the folllowing format: "yyyy-mm-dd".

Type:
string writable
Implemented in:
settings

A minimum width value for all survey elements.

Default value: "300px"

You can override this setting for individual elements: minWidth.

Type:
string writable
Implemented in:
settings

A value to save in survey results when respondents select the "None" choice item.

Default value: "none"

Type:
string writable
Implemented in:
settings

An object that configures notifications.

Nested properties:

Type:
{ lifetime: number; } writable
Implemented in:
settings

An object with properties that configure question numbering.

Nested properties:

Type:
{ includeQuestionsWithHiddenNumber: boolean; includeQuestionsWithHiddenTitle: boolean; } writable
Implemented in:
settings

An object with properties that apply to Dynamic Panel questions.

Nested properties:

Type:
{ maxPanelCount: number; maxPanelCountInCondition: number; } writable
Implemented in:
settings

A function that allows you to define custom parsing rules for numbers represented as string values.

The following code shows a template that you can use to implement the parseNumber function:

import { settings } from "survey-core";

settings.parseNumber = (stringValue, numericValue) => {
  if (typeof stringValue !== "string" || !stringValue)
    return numericValue;
  let parsedNumber = numericValue;
  // ...
  // Parsing the number according to custom parsing rules
  // ...
  return parsedNumber;
};
Type:
(stringValue: any, numericValue: number) => number writable
Return Value:

A number that results from parsing the string value.

Implemented in:
settings
See also:
settings.serialization

Specifies which part of a choice item responds to a drag gesture in Ranking questions.

Possible values:

Type:
string writable
Implemented in:
settings

A maximum number of rate values in a Rating question.

Default value: 20

Type:
number writable
Implemented in:
settings

An object with properties that configure questions in read-only mode.

Nested properties:

Type:
{ enableValidation: boolean; commentRenderMode: string; textRenderMode: string; } writable
Implemented in:
settings

A value to save in survey results when respondents select the "Refuse to answer" choice item.

Default value: "refused"

Type:
string writable
Implemented in:
settings

An object that contains properties related to JSON serialization.

Nested properties:

Type:
{ itemValueSerializeAsObject: boolean; itemValueSerializeDisplayText: boolean; localizableStringSerializeAsObject: boolean; matrixDropdownColumnSerializeTitle: boolean; } writable
Implemented in:
settings
See also:
settings.parseNumber

A method that displays a modal dialog.

Parameters:

View Demo

Type:
(options: IDialogOptions, rootElement?: any) => any writable
Implemented in:
settings
Type:
string writable
Implemented in:
settings

Allows you to hide the maximum length indicator in text input questions.

If you specify a question's maxLength property or a survey's maxTextLength property, text input questions indicate the number of entered characters and the character limit. Assign false to the settings.showMaxLengthIndicator property if you want to hide this indicator.

Default value: true

Type:
boolean writable
Implemented in:
settings

An object whose properties specify the order of the special choice items ("None", "Other", "Select All", "Refuse to answer", "Don't know") in select-based questions.

Default value: { selectAllItem: [-1], noneItem: [1], refuseItem: [2], dontKnowItem: [3], otherItem: [4] }

Use this object to reorder special choices. Each property accepts an array of integer numbers. Negative numbers place a special choice item above regular choice items, positive numbers place it below them. For instance, the code below specifies the following order of choices: None, Select All, regular choices, Other.

import { settings } from "survey-core";

settings.specialChoicesOrder.noneItem = [-2];
settings.specialChoicesOrder.selectAllItem = [-1];
settings.specialChoicesOrder.otherItem = [1];

If you want to duplicate a special choice item above and below other choices, add two numbers to the corresponding array:

settings.specialChoicesOrder.selectAllItem = [-1, 3] // Displays Select All above and below other choices
Type:
{ selectAllItem: number[]; noneItem: number[]; refuseItem: number[]; dontKnowItem: number[]; otherItem: number[]; } writable
Implemented in:
settings

Specifies whether to store date-time values in the following format: "YYYY-MM-DDThh:mm:ss.sssZ". Applies only to form fields with inputType set to "datetime-local".

Default value: false

If you enable this setting, date-time values are converted from local time to UTC when they are saved to the survey's data object, while the question values remain in local time. Therefore, when you specify default values using a question's defaultValue property, you need to use local time, but if you specify them using the data object, use a UTC date-time value in the following format: "YYYY-MM-DDThh:mm:ss.sssZ".

const surveyJson = {
  "elements": [{
    "name": "datetime",
    "type": "text",
    "title": "Select a date and time",
    "inputType": "datetime-local",
    "defaultValue": "2024-07-16T12:15:00" // Local date-time value
  }]
}
import { Model } from "survey-core";
const surveyJson = { ... }
const survey = new Model(surveyJson);

survey.data = {
  datetime: "2024-07-16T12:15:00.000Z" // UTC date-time value
}
Type:
boolean writable
Implemented in:
settings

A list of supported validators by question type.

Type:
{ question: string[]; comment: string[]; text: string[]; checkbox: string[]; imagepicker: string[]; } writable
Implemented in:
settings

Specifies whether to close the drop-down menu of a Multi-Select Dropdown (Tag Box) question after a user selects a value.

This setting applies to all Multi-Select Dropdown questions on a web page. You can use the closeOnSelect property to specify the same setting for an individual Multi-Select Dropdown question.

Type:
boolean writable
Implemented in:
settings

An object that contains properties related to triggers.

Nested properties:

Type:
{ changeNavigationButtonsOnComplete: boolean; executeCompleteOnValueChanged: boolean; executeSkipOnValueChanged: boolean; } writable
Implemented in:
settings

An object with properties that configure surveys when they work with a web service.

Nested properties:

Type:
{ onBeforeRequestChoices: (sender: any, options: IBeforeRequestChoicesOptions) => void; encodeUrlParams: boolean; cacheLoadedChoices: boolean; disableQuestionWhileLoadingChoices: boolean; } writable
Implemented in:
settings

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4