|
Creates a new object that has the same type and properties as the current SurveyJS object.
- Type:
-
() => Base
- Implemented in:
-
Base
|
|
Collapses the survey element.
In collapsed state, the element displays only title and description .
- Type:
-
() => void
- Implemented in:
-
SurveyElement
- See also:
-
title *
, description *
, state *
, toggleState *
, expand *
, isCollapsed *
, isExpanded
|
|
Returns true if the survey element or its child elements have validation errors.
This property contains the result of the most recent validation. This result may be outdated. Call the validate method to get an up-to-date value.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
errors
|
|
Returns an object in which keys are UI elements and values are CSS classes applied to them.
Use the following events of the SurveyModel object to override CSS classes:
- Type:
-
any readonly
- Implemented in:
-
SurveyElement
|
|
Explanatory text displayed under the title.
- Type:
-
string writable
- Implemented in:
-
SurveyElementCore
- See also:
-
hasDescription
|
|
Validation errors. Call the validate() method to validate survey element data.
- Type:
-
SurveyError[] writable
- Implemented in:
-
SurveyElement
- See also:
-
validate
|
|
expand
method
|
|
Expands the survey element.
- Type:
-
() => void
- Implemented in:
-
SurveyElement
- See also:
-
state *
, toggleState *
, collapse *
, isCollapsed *
, isExpanded
|
|
Assigns a new configuration to the current SurveyJS object. This configuration is taken from a passed JSON object.
The JSON object should contain only serializable properties of this SurveyJS object. Event handlers and properties that do not belong to the SurveyJS object are ignored.
- Type:
-
(json: any) => void
- Parameters:
-
json, type: any
, A JSON object with properties that you want to apply to the current SurveyJS object.
- Implemented in:
-
Base
- See also:
-
toJSON
|
|
Returns the survey's locale.
If a default locale is used, this method returns an empty string. To get the applied locale in this case, use the following code:
import { surveyLocalization } from 'survey-core';
const defaultLocale = surveyLocalization.defaultLocale;
- Type:
-
() => string
- Implemented in:
-
SurveyElement
- See also:
-
Localization & Globalization
|
|
Returns a JsonObjectProperty object with metadata about a serializable property that belongs to the current SurveyJS object.
If the property is not found, this method returns null .
- Type:
-
(propName: string) => JsonObjectProperty
- Parameters:
-
propName, type: string
, A property name.
- Implemented in:
-
Base
|
|
Returns the value of a property with a specified name.
If the property is not found or does not have a value, this method returns either undefined , defaultValue specified in the property configuration, or a value passed as the defaultValue parameter.
- Type:
-
(name: string, defaultValue?: any) => any
- Parameters:
-
name, type: string
, A property name.
defaultValue, type: any
, (Optional) A value to return if the property is not found or does not have a value.
- Implemented in:
-
Base
|
|
Returns the object type as it is used in the JSON schema.
- Type:
-
() => string
- Implemented in:
-
Base
|
|
Returns true if the survey element has a description.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElementCore
- See also:
-
description
|
|
Increases or decreases an indent of survey element content from the left edge. Accepts positive integer values and 0. Does not apply in the Default V2 theme.
- Type:
-
number writable
- Implemented in:
-
SurveyElement
- See also:
-
rightIndent
|
|
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
Returns true if the survey element is collapsed.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
state *
, toggleState *
, collapse *
, expand *
, isExpanded
|
|
Use this method to find out if the current object is of a given typeName or inherited from it.
- Type:
-
(typeName: string) => boolean
- Parameters:
-
typeName, type: string
, One of the values listed in the getType() description.
- Implemented in:
-
Base
- See also:
-
getType
|
|
Returns true if the survey is being designed in Survey Creator.
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
isExpanded
property
|
|
Returns true if the survey element is expanded.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
state *
, toggleState *
, collapse *
, expand *
, isCollapsed
|
|
Returns true if the object configuration is being loaded from JSON.
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
Returns true if the survey element is a page.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
Base.getType
|
|
Returns true if the survey element is a panel.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
Base.getType
|
|
Returns true if the survey element is a question.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
Base.getType
|
|
Returns true if the survey element or its parent element is read-only.
If you want to switch a survey element to the read-only state based on a condition, specify the enableIf property. Refer to the following help topic for information: Conditional Visibility.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
readOnly
|
|
Returns true if a passed value is an empty string, array, or object or if it equals to undefined or null .
- Type:
-
(value: any, trimString?: boolean) => boolean
- Parameters:
-
value, type: any
, A value to be checked.
trimString, type: boolean
, (Optional) When this parameter is true , the method ignores whitespace characters at the beginning and end of a string value. Pass false to disable this functionality.
- Implemented in:
-
Base
|
|
Gets or sets maximum survey element width in CSS values.
Default value: "100%" (taken from settings.maxWidth )
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
minWidth *
, renderWidth *
, width
|
|
Gets or sets minimum survey element width in CSS values.
Default value: "300px" (taken from settings.minWidth )
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
maxWidth *
, renderWidth *
, width
|
|
A survey element identifier.
Question names must be unique.
- Type:
-
string writable
- Implemented in:
-
SurveyElement
|
|
An event that is raised when an ItemValue property is changed.
Parameters:
sender : this
A SurveyJS object whose property contains an array of ItemValue objects.
options.obj : ItemValue
An ItemValue object.
options.propertyName : String
The name of the property to which an array of ItemValue objects is assigned (for example, "choices" or "rows" ).
options.name : "text" | "value"
The name of the changed property.
options.newValue: any`
A new value for the property.
- Type:
-
Event<(sender: Base, options: any) => any, any>
- Implemented in:
-
Base
|
|
An event that is raised when a property of this SurveyJS object has changed.
Parameters:
sender : this
A SurveyJS object whose property has changed.
options.name : String
The name of the changed property.
options.newValue : any
A new value for the property.
options.oldValue : any
An old value of the property. If the property is an array, oldValue contains the same array as newValue does.
- Type:
-
EventBase<Base>
- Implemented in:
-
Base
|
|
A Dynamic Panel, Dynamic Matrix, or Dropdown Matrix that includes the current question.
This property is null for standalone questions.
- Type:
-
E readonly
- Implemented in:
-
SurveyElement
|
|
Makes the survey element read-only.
If you want to switch a survey element to the read-only state based on a condition, specify the enableIf property. Refer to the following help topic for information: Conditional Visibility.
- Type:
-
boolean writable
- Implemented in:
-
SurveyElement
- See also:
-
isReadOnly
|
|
registerPropertyChangedHandlers
method
|
|
Registers a function to call when a property value changes.
- Type:
-
(propertyNames: string[], handler: any, key?: string) => void
- Parameters:
-
propertyNames, type: string[]
, An array of one or multiple property names.
handler, type: any
, A function to call when one of the listed properties change.
key, type: string
, (Optional) A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
- Implemented in:
-
Base
- See also:
-
unregisterPropertyChangedHandlers
|
|
Returns a calculated width of the rendered survey element in CSS values.
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
width *
, minWidth *
, maxWidth
|
|
Increases or decreases an indent of survey element content from the right edge. Accepts positive integer values and 0. Does not apply in the Default V2 theme.
- Type:
-
number writable
- Implemented in:
-
SurveyElement
- See also:
-
indent
|
|
Assigns a new value to a specified property.
- Type:
-
(name: string, val: any) => void
- Parameters:
-
name, type: string
, A property name.
val, type: any
, A new value for the property.
- Implemented in:
-
Base
|
|
Gets and sets the survey element's expand state.
Possible values:
"default" (default) - The survey element is displayed in full and cannot be collapsed in the UI.
"expanded" - The survey element is displayed in full and can be collapsed in the UI.
"collapsed" - The survey element displays only title and description and can be expanded in the UI.
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
toggleState *
, collapse *
, expand *
, isCollapsed *
, isExpanded
|
|
Returns the survey object.
- Type:
-
ISurvey readonly
- Implemented in:
-
SurveyElement
|
|
A title for the survey element. If title is undefined, the name property value is displayed instead.
Empty pages and panels do not display their titles or names.
- Type:
-
string writable
- Implemented in:
-
SurveyElementCore
- See also:
-
Configure Question Titles
|
|
Toggles the survey element's state between collapsed and expanded.
- Type:
-
() => boolean
- Implemented in:
-
SurveyElement
- See also:
-
state *
, collapse *
, expand *
, isCollapsed *
, isExpanded
|
|
Returns a JSON object that corresponds to the current SurveyJS object.
- Type:
-
() => any
- Implemented in:
-
Base
- See also:
-
fromJSON
|
|
unregisterPropertyChangedHandlers
method
|
|
Unregisters value change event handlers for the specified properties.
- Type:
-
(propertyNames: string[], key?: string) => void
- Parameters:
-
propertyNames, type: string[]
, An array of one or multiple property names.
key, type: string
, (Optional) A key of the registration that you want to cancel.
- Implemented in:
-
Base
- See also:
-
registerPropertyChangedHandlers
|
|
Sets survey element width in CSS values.
Default value: ""
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
minWidth *
, maxWidth
|