settings
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";
Properties
Methods
Events
Specifies whether to display an empty description for pages and panels when they are being designed in Survey Creator.
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to display an empty title for pages and panels when they are being designed in Survey Creator.
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
A suffix added to the name of the property that stores comments.
Default value: "-Comment"
You can specify this setting for an individual survey: commentSuffix
.
- Type:
- string writable
- Implemented in:
- settings
An object that configures string comparison.
Nested properties:
trimStrings
:Boolean
Specifies whether to remove whitespace from both ends of a string before the comparison. Default value:true
.caseSensitive
:Boolean
Specifies whether to differentiate between capital and lower-case letters. Default value:false
.
- Type:
- { trimStrings: boolean; caseSensitive: boolean; } writable
- Implemented in:
- settings
A property that allows you to display a custom confirm dialog instead of the standard browser dialog. Set this property to a function that renders your custom dialog window.
- 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
Specifies a property key that stores a translation for the default locale.
Default value: "default"
- Type:
- string writable
- Implemented in:
- settings
- See also:
- storeDuplicatedTranslations
Disables the question while choices are being loaded from a web service.
Default value: false
- Type:
- boolean writable
- Implemented in:
- settings
- See also:
- settings.useCachingForChoicesRestful
Specifies an action to perform when users press the Enter key within a survey.
Possible values:
"moveToNextEditor"
- Moves focus to the next editor."loseFocus"
- Removes focus from the current editor."default"
- Behaves as a standard<input>
element.
- Type:
- "default" | "moveToNextEditor" | "loseFocus" writable
- Implemented in:
- settings
Specifies environment in which SurveyJS will exist
- Type:
- ISurveyEnvironment writable
- Implemented in:
- settings
Specifies whether to re-evaluate an expression associated with the Complete trigger immediately when a question value changes. If the expression evaluates to true
, the trigger is executed.
Keep this property set to false
if you want to re-evaluate the Complete trigger's expression only when the respondents navigate to another page.
Default value: false
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to re-evaluate an expression associated with the Skip trigger immediately when a question value changes. If the expression evaluates to true
, the trigger is executed.
Disable this property if you want to re-evaluate the Skip trigger's expression only when the respondents navigate to another page.
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
Enable this property if you want to serialize ItemValue
instances as objects even when they include only the value
property.
import { ItemValue, settings } from "survey-core";
settings.itemValueAlwaysSerializeAsObject = true;
const item = new ItemValue(5);
const itemString = item.toJSON(); // Produces { value: 5 } instead of 5
- Type:
- boolean writable
- Implemented in:
- settings
Enable this property if you want to serialize the text
property of ItemValue
objects even when it is empty or equal to the value
property.
import { ItemValue, settings } from "survey-core";
settings.itemValueAlwaysSerializeText = true;
const item = new ItemValue("item1");
const itemString = item.toJSON(); // Produces { value: "item1", text: "item1" } instead of "item1"
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to add questions to the DOM only when they get into the viewport.
Default value: false
This is an experimental feature that may not work as expected in all use cases.
- Type:
- boolean writable
- Implemented in:
- settings
Contains properties that apply to Single-Choice, Multiple-Choice, and Dynamic Matrix questions.
Nested properties:
columnWidthsByType
:Object
An object that specifies fixed and minimum column width based on the column type.
Example:settings.matrix.columnWidthsByType = { "tagbox": { minWidth: "240px", width: "300px" } }
rateSize
:"small"
(default) |"normal"
Specifies the size of rate values. Applies to Rating Scale questions within matrixes.
- Type:
- { columnWidthsByType: { [index: string]: { minWidth?: string; width?: string; }; }; rateSize: "small" | "normal"; } writable
- Implemented in:
- settings
The default type of matrix cells in the Multiple-Choice Matrix and Dynamic Matrix question types.
Default value: "dropdown"
You can specify this setting for individual questions or matrix columns: cellType
. Refer to the cellType
property description for information on possible values.
- Type:
- string writable
- Implemented in:
- settings
Specifies a property key that stores an object with default cell values in Single-Choice Matrix questions.
Default value: "default"
- Type:
- string writable
- Implemented in:
- settings
A maximum number of rows in a Dynamic Matrix.
Default value: 1000
You can specify this setting for an individual Dynamic Matrix: maxRowCount
.
- Type:
- number writable
- Implemented in:
- settings
A maximum number of matrix rows included in the Condition drop-down menu in Survey Creator. This menu is used to configure conditional survey logic.
Default value: 1
If you set this property to 0, the Condition menu does not include any matrix rows. Users still can specify conditions that use matrix rows but only with Manual Entry.
- Type:
- number writable
- Implemented in:
- settings
Disable this property if you want to render the Remove action in Dynamic Matrix as a button. Otherwise, the action is rendered as an icon.
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
A suffix added to the name of the property that stores total values. The resulting property name consists of the matrix name and the suffix.
Default value: "-total"
- Type:
- string 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
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:
lifetime
:Number
Specifies a time period during which a notification is displayed; measured in milliseconds.
- Type:
- { lifetime: number; } writable
- Implemented in:
- settings
A maximum number of panels from Dynamic Panel included in the Condition drop-down menu in Survey Creator. This menu is used to configure conditional survey logic.
Default value: 1
If you set this property to 0, the Condition menu does not include any panel questions. Users still can specify conditions that use panel questions but only with Manual Entry.
- Type:
- number writable
- Implemented in:
- settings
A maximum number of panels in Dynamic Panel.
Default value: 100
You can specify this setting for an individual Dynamic Panel: maxPanelCount
.
- Type:
- number writable
- Implemented in:
- settings
Specifies which part of a choice item responds to a drag gesture in Ranking questions.
Possible values:
"entireItem"
(default) - Users can use the entire choice item as a drag handle."icon"
- Users can only use the choice item icon as a drag handle.
- Type:
- string writable
- Implemented in:
- settings
Specifies how to render the input field of Comment questions in read-only mode.
Possible values:
"textarea"
(default) - Renders the input field as a disabled<textarea>
element."div"
- Renders the input field as a<div>
element with a non-editable question value within it.
- Type:
- string writable
- Implemented in:
- settings
Specifies how to render the input field of Text questions in read-only mode.
Possible values:
"input"
(default) - Renders the input field as a disabled<input>
element."div"
- Renders the input field as a<div>
element with a non-editable question value within it.
- Type:
- string writable
- Implemented in:
- settings
Enable this property if you want to serialize LocalizableString
instances as objects even when they include only a translation string for the default locale. For example, "Custom String"
will be serialized as { default: "Custom String" }
.
Default value: false
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to number questions whose hideNumber
property is enabled.
Default value: false
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to number questions whose titleLocation
property is set to "hidden"
.
Default value: false
- Type:
- boolean writable
- Implemented in:
- settings
Specifies the direction in which to lay out Checkbox and Radiogroup items. This setting affects the resulting UI when items are arranged in more than one column.
Possible values:
"row"
(default) - Items fill the current row, then move on to the next row."column"
- Items fill the current column, then move on to the next column.
- Type:
- string writable
- Implemented in:
- settings
Specifies whether surveys should store translation strings that equal the translation string specified by the "default"
key.
Default value: false
- Type:
- boolean writable
- Implemented in:
- settings
- See also:
- settings.defaultLocaleName
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 TagBox question after a user selects a value.
This setting applies to all TagBox questions on a page. You can use the closeOnSelect property to specify the same setting for an individual TagBox question.
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to cache choices loaded from a web service.
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
- See also:
- settings.disableOnGettingChoicesFromWeb
Disable this property if you want internal SurveyJS functions to use methods that work with UTC date and time (setUTCDate()
setUTCHours()
, etc.) instead of methods that work with local date and time (setYear
, setHours()
, etc.).
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
Specifies whether to encode URL parameters when you access a web service.
Default value: true
- Type:
- boolean writable
- Implemented in:
- settings
Copyright © 2023 Devsoft Baltic OÜ. All rights reserved.