|
Add error into the question error list.
- Type:
-
(error: string | SurveyError) => void
- Parameters:
-
error, type: string | SurveyError
- Implemented in:
-
Question
|
|
Add a new dynamic panel based on the template Panel.
- Type:
-
() => PanelModel
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
template *
, panelCount *
, panels *
, renderMode
|
|
Add a new dynamic panel based on the template Panel. It checks if canAddPanel returns true and then calls addPanel method.
If a renderMode is different from "list" and the current panel has erros, then
- Type:
-
() => PanelModel
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
template *
, panelCount *
, panels *
, canAddPanel
|
|
Set this property to false to hide the 'Add New' button
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- True
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
allowRemovePanel
|
|
Set this property to false to hide the 'Remove' button
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- True
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
allowAddPanel
|
|
- Type:
-
"true" | "false" readonly
- Implemented in:
-
Question
|
|
Returns true when an end user may add a new panel. The question is not read only and panelCount less than maxPanelCount
and renderMode is "list" or the current panel doesn't have any errors
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
isReadOnly *
, panelCount *
, maxPanelCount *
, renderMode
|
|
Returns true when an end user may remove a panel. The question is not read only and panelCount is more than minPanelCount
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
isReadOnly *
, panelCount *
, minPanelCount
|
|
Get is question ready to use
- Type:
-
() => void
- Implemented in:
-
Question
|
|
Call this function to clear all errors in the question
- Type:
-
() => void
- Implemented in:
-
Question
|
|
Gets or sets a value that specifies how invisible question clears the value. By default the behavior is define by Survey "clearInvisibleValues" property.
The following options are available:
default (default) - Survey "clearInvisibleValues" property defines the behavior.
none - do not clear invisible value.
onHidden - clear the question value when it becomes invisible. If a question has value and it was invisible initially then survey clears the value on completing.
onComplete - clear invisible question value on survey complete.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- default
- Accepted values:
-
default
, none
, onComplete
, onHidden
- Implemented in:
-
Question
- See also:
-
SurveyModel.clearInvisibleValues *
, Question.visible *
, onComplete
|
|
Call this function to remove values from the current question, that end-user will not be able to enter.
For example the value that doesn't exists in a radigroup/dropdown/checkbox choices or matrix rows/columns.
- Type:
-
() => void
- Implemented in:
-
Question
|
|
Clear the question value. It clears the question comment as well.
- Type:
-
() => void
- Implemented in:
-
Question
|
|
Make a clone of the existing object. Create a new object of the same type and load all properties into it.
- Type:
-
() => Base
- Implemented in:
-
Base
|
|
- Type:
-
() => void
- Implemented in:
-
SurveyElement
- See also:
-
state
|
|
Set it to true, to show a confirmation dialog on removing a panel
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
ConfirmDeleteText
|
|
Use this property to change the default text showing in the confirmation delete dialog on removing a panel.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Returns true if a question or a container (panel/page) or their chidren have an error.
The value can be out of date. hasErrors function should be called to get the correct value.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
|
|
The correct answer on the question. Set this value if you are doing a quiz.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
any writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
SurveyModel.getCorrectAnswerCount *
, SurveyModel.getInCorrectAnswerCount
|
|
Returns all css classes that used for rendering the question, panel or page.
You can use survey.onUpdateQuestionCssClasses event to override css classes for a question, survey.onUpdatePanelCssClasses event for a panel and survey.onUpdatePageCssClasses for a page.
- Type:
-
any readonly
- Implemented in:
-
SurveyElement
- See also:
-
SurveyModel.updateQuestionCssClasses *
, SurveyModel.updatePanelCssClasses *
, SurveyModel.updatePageCssClasses
|
|
Returns the validation errors count.
- Type:
-
number readonly
- Implemented in:
-
Question
|
|
The index of current active dynamical panel when the renderMode is not "list". If there is no dymamic panel (panelCount = 0) or renderMode equals "list" it returns -1, otherwise it returns a value from 0 to panelCount - 1.
- Type:
-
number writable
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
currentPanel *
, panels *
, panelCount *
, renderMode
|
|
The current active dynamical panel when the renderMode is not "list". If there is no dymamic panel (panelCount = 0) or renderMode equals "list" it returns null.
- Type:
-
PanelModel readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
currenIndex *
, panels *
, panelCount *
, renderMode
|
|
The link to the custom widget.
- Type:
-
QuestionCustomWidget readonly
- Implemented in:
-
Question
|
|
If it is not empty, then this value is set to every new panel, including panels created initially, unless the defaultValue is not empty
- Type:
-
any writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
defaultValue *
, defaultValueFromLastRow
|
|
A default value for the question. Ignored for question types that cannot have a value (for example, HTML).
The default value is used as a question value in the following cases:
- While the survey is being loaded from JSON.
- The question is just added to the survey and does not yet have an answer.
- The respondent left the answer empty.
- Type:
-
any writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
defaultValueExpression
|
|
An expression used to calculate the defaultValue.
This expression applies until the question value is specified by an end user or programmatically.
An expression can reference other questions as follows:
{other_question_name}
{panel.other_question_name} (to access questions inside the same dynamic panel)
{row.other_question_name} (to access questions inside the same dynamic matrix or multi-column dropdown)
An expression can also include built-in and custom functions for advanced calculations. For example, if the defaultValue should be today's date, set the defaultValueExpression to "today()" , and the corresponding built-in function will be executed each time the survey is loaded. Refer to the following help topic for more information: Use Functions in Expressions.
- Type:
-
any writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
defaultValue
|
|
Set it to true to copy the value into new added panel from the last panel. If defaultPanelValue is set and this property equals to true,
then the value for new added panel is merging.
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
defaultValue *
, defaultPanelValue
|
|
Question description location. By default, value is "default" and it depends on survey questionDescriptionLocation property
You may change it to "underInput" to render it under question input or "underTitle" to rendered it under title.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- default
- Accepted values:
-
default
, underInput
, underTitle
- Implemented in:
-
Question
- See also:
-
description *
, Survey.questionDescriptionLocation
|
|
An expression that returns true or false. If it returns false the Question becomes read only and an end-user will not able to answer on the qustion. The library runs the expression on survey start and on changing a question value. If the property is empty then readOnly property is used.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
readOnly *
, isReadOnly
|
|
The list of errors. It is created by callig hasErrors functions
- Type:
-
any writable
- Implemented in:
-
SurveyElement
- See also:
-
hasErrors
|
|
expand
method
|
|
- Type:
-
() => void
- Implemented in:
-
SurveyElement
- See also:
-
state
|
|
Move the focus to the input of this question.
- Type:
-
(onError?: boolean) => void
- Parameters:
-
onError, type: boolean
, set this parameter to true, to focus the input with the first error, other wise the first input will be focused.
- Implemented in:
-
Question
|
|
Load object properties and elements. It doesn't reset properties that was changed before and they are not defined in the json parameter.
- Type:
-
(json: any) => void
- Parameters:
-
json, type: any
, the object JSON definition
- Implemented in:
-
Base
- See also:
-
toJSON
|
|
Returns the title after processing the question template.
- Type:
-
string readonly
- Implemented in:
-
Question
- See also:
-
SurveyModel.questionTitleTemplate
|
|
Returns a copy of question errors survey. For some questions like matrix and panel dynamic it includes the errors of nested questions.
- Type:
-
() => any
- Implemented in:
-
Question
|
|
Return the question value as a display text. For example, for dropdown, it would return the item text instead of item value.
- Type:
-
(keysAsText: boolean, value?: any) => any
- Parameters:
-
keysAsText, type: boolean
, Set this value to true, to return key (in matrices questions) as display text as well.
value, type: any
, use this parameter, if you want to get display value for this value and not question.value. It is undefined by default.
- Implemented in:
-
Question
|
|
Returns the current survey locale
- Type:
-
() => string
- Implemented in:
-
SurveyElement
- See also:
-
SurveyModel.locale
|
|
Returns question answer data as a plain object: with question title, name, value and displayValue.
For complex questions (like matrix, etc.) isNode flag is set to true and data contains array of nested objects (rows)
set options.includeEmpty to false if you want to skip empty answers
- Type:
-
(options?: { includeEmpty?: boolean; includeQuestionTypes?: boolean; calculations?: any; }) => any
- Parameters:
-
options, type: { includeEmpty?: boolean; includeQuestionTypes?: boolean; calculations?: any; }
- Implemented in:
-
Question
|
|
Returns the serializable property that belongs to this instance by property name. It returns null if the property is not exists.
- Type:
-
(propName: string) => JsonObjectProperty
- Parameters:
-
propName, type: string
, property name
- Implemented in:
-
Base
|
|
Returns the property value by name
- Type:
-
(name: string, defaultValue?: any) => any
- Parameters:
-
name, type: string
, property name
defaultValue, type: any
- Implemented in:
-
Base
|
|
Returns the element template name without prefix. Typically it equals to getType().
- Type:
-
() => string
- Implemented in:
-
Base
- See also:
-
getType
|
|
Return the title location based on question titleLocation property and QuestionTitleLocation of it's parents
- Type:
-
() => string
- Implemented in:
-
Question
- See also:
-
titleLocation *
, PanelModelBase.QuestionTitleLocation *
, SurveyModel.QuestionTitleLocation
|
|
Returns the type of the object as a string as it represents in the json.
- Type:
-
() => string
- Implemented in:
-
Question
|
|
Goes to the next panel in the PanelDynamic
Returns true, if it can move to the next panel. It can return false if the renderMode is "list" or the current panel has errors.
- Type:
-
() => boolean
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
renderMode
|
|
Goes to the previous panel in the PanelDynamic
- Type:
-
() => void
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Question, Panel and Page description. It renders under element title by using smaller font. Unlike the question title, description can be empty.
Please note, this property is hidden for questions without input, for example html question.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElementCore
- See also:
-
title
|
|
Returns true if there is a validation error(s) in the question.
- Type:
-
(fireCallback?: boolean, rec?: any) => boolean
- Parameters:
-
fireCallback, type: boolean
, set it to true to show an error in UI.
rec, type: any
- Implemented in:
-
Question
|
|
Returns false if the question doesn't have an input element, for example: QuestionHtmlModel
- Type:
-
boolean readonly
- Implemented in:
-
Question
- See also:
-
hasSingleInput
|
|
Returns false if the question doesn't have an input element or have multiple inputs: matrices or panel dynamic
- Type:
-
boolean readonly
- Implemented in:
-
Question
- See also:
-
hasInput
|
|
Returns false if the question doesn't have a title property, for example: QuestionHtmlModel, or titleLocation property equals to "hidden"
- Type:
-
boolean readonly
- Implemented in:
-
Question
- See also:
-
titleLocation
|
|
Set hideNumber to true to stop showing the number for this question. The question will not be counter
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
visibleIndex *
, titleLocation
|
|
The unique identificator. It is generated automatically.
- Type:
-
string writable
- Implemented in:
-
Question
|
|
The left indent. Set this property to increase the survey element left indent.
- Type:
-
number writable
- Implemented in:
-
SurveyElement
|
|
Returns true if the object is inluded into survey, otherwise returns false.
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
Returns true if the question may have a title located on the left
- Type:
-
boolean readonly
- Implemented in:
-
Question
|
|
Returns true if the Element is in the collapsed state
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
state *
, collapse *
, isExpanded
|
|
Use this method to find out if the current instance is of the given typeName or inherited from it.
- Type:
-
(typeName: string) => boolean
- Parameters:
-
typeName, type: string
, One of the values listed in the [getType()](https://surveyjs.io/Documentation/Library?id=surveymodel#getType) description.
- Implemented in:
-
Base
- See also:
-
getType
|
|
Returns true if the question in design mode right now.
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
Returns true if the question value is empty
- Type:
-
() => boolean
- Implemented in:
-
Question
|
|
isExpanded
property
|
|
Returns true if the Element is in the expanded state
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
state *
, expand *
, isCollapsed
|
|
Returns true if the object is loading from Json at the current moment.
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
Returns true when currentIndex is more than or equal 0 and less than panelCount - 1.
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
currenIndex *
, currenPanel *
, panelCount
|
|
Returns true if it is a page.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
|
|
Returns true if it is a panel.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
|
|
Return true if there is a parent (page or panel) and it is visible
- Type:
-
boolean readonly
- Implemented in:
-
Question
|
|
Returns true when currentIndex is more than 0.
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
currenIndex *
, currenPanel
|
|
Returns true when the renderMode equals to "progressBottom" or "progressTopBottom"
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Returns true when the renderMode equals to "progressTop" or "progressTopBottom"
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Returns true if it is a question.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
|
|
Returns true when showRangeInProgress equals to true, renderMode doesn't equal to "list" and panelCount is >= 2.
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Returns true if readOnly property is true or survey is in display mode or parent panel/page is readOnly.
- Type:
-
boolean readonly
- Implemented in:
-
Question
- See also:
-
SurveyModel.model *
, readOnly
|
|
Returns true when renderMode equals to "list".
- Type:
-
boolean readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
renderMode
|
|
Set this property to true, to make the question a required. If a user doesn't answer the question then a validation error will be generated.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
|
|
Returns true if a value undefined, null, empty string or empty array.
- Type:
-
(value: any, trimString?: boolean) => boolean
- Parameters:
-
value, type: any
trimString, type: boolean
, a boolean parameter, default value true. If true then it trims the string and functions returns true for a string that contains white spaces only.
- Implemented in:
-
Base
|
|
Returns true if the question is visible or survey is in design mode right now.
- Type:
-
boolean readonly
- Implemented in:
-
Question
|
|
The duplication value error text. Set it to show the text different from the default.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
keyName
|
|
Set it to a question name used in the template panel and the library shows duplication error, if there are same values in different panels of this question.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
keyDuplicationError
|
|
The maximum panel count. A user could not add a panel if the panelCount equals to maxPanelCount
- Type:
-
number writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- 100
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
panelCount *
, minPanelCount
|
|
Use it to set the specific maxWidth constraint to the survey element like css style (%, px, em etc).
- Type:
-
string writable
- Implemented in:
-
SurveyElement
|
|
The minimum panel count. A user could not delete a panel if the panelCount equals to minPanelCount
- Type:
-
number writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
panelCount *
, maxPanelCount
|
|
Use it to set the specific minWidth constraint to the survey element like css style (%, px, em etc).
- Type:
-
string writable
- Implemented in:
-
SurveyElement
|
|
Move question to a new container Page/Panel. Add as a last element if insertBefore parameter is not used or inserted into the given index,
if insert parameter is number, or before the given element, if the insertBefore parameter is a question or panel
- Type:
-
(container: IPanel, insertBefore?: any) => boolean
- Parameters:
-
container, type: IPanel
, Page or Panel to where a question is relocated.
insertBefore, type: any
, Use it if you want to set the question to a specific position. You may use a number (use 0 to insert int the beginning) or element, if you want to insert before this element.
- Implemented in:
-
Question
|
|
This is the identifier of a survey element - question or panel.
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
valueName
|
|
The property returns the question number. If question is invisible then it returns empty string.
If visibleIndex is 1, then no is 2, or 'B' if survey.questionStartIndex is 'A'.
- Type:
-
string readonly
- Implemented in:
-
Question
- See also:
-
SurveyModel.questionStartIndex
|
|
A text displayed when the dynamic panel contains no entries. Applies only in the Default V2 theme.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Event that raised on changing property of the ItemValue object.
sender - the object that owns the property
options.propertyName - the property name to which ItemValue array is belong. It can be "choices" for dropdown question
options.obj - the instance of ItemValue object which property has been changed
options.name - the property of ItemObject that has been changed
options.oldValue - old value
options.newValue - new value
- Type:
-
Event<(sender: Base, options: any) => any, any>
- Implemented in:
-
Base
|
|
Event that raise on property change of the sender object
sender - the object that owns the property
options.name - the property name that has been changed
options.oldValue - old value. Please note, it equals to options.newValue if property is an array
options.newValue - new value.
- Type:
-
EventBase<Base>
- Implemented in:
-
Base
|
|
The event is fired when isReady property of question is changed.
options.question - the question
options.isReady - current value of isReady
options.oldIsReady - old value of isReady
- Type:
-
EventBase<Question>
- Implemented in:
-
Question
|
|
Get/set the page where the question is located.
- Type:
-
IPage writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
|
|
Use this property to change the default value of add panel button text.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Use this property to get/set the number of dynamic panels.
- Type:
-
number writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Accepted values:
-
0
, 1
, 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9
, 10
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
template *
, minPanelCount *
, maxPanelCount *
, addPanel *
, removePanel *
, removePanelUI
|
|
Use this property to change the default next button text. Next button shows the next panel, change the currentPanel, when the renderMode doesn't equal to "list".
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
currentPanel *
, currentIndex *
, renderMode
|
|
Use this property to change the default previous button text. Previous button shows the previous panel, change the currentPanel, when the renderMode doesn't equal to "list".
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
currentPanel *
, currentIndex *
, renderMode
|
|
Use this property to change the location of the remove button relative to the panel.
By default the value is "bottom". You may set it to "right" and remove button will appear to the right of the panel.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- bottom
- Accepted values:
-
bottom
, right
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Use this property to change the default value of remove panel button text.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
|
|
The array of dynamic panels created based on panel template
- Type:
-
any readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
template *
, panelCount
|
|
Use this property to allow the end-user to collapse/expand the panels. It works only if the renderMode property equals to "list" and templateTitle property is not empty. The following values are available:
default - the default value. User can't collapse/expand panels
expanded - User can collapse/expand panels and all panels are expanded by default
collapsed - User can collapse/expand panels and all panels are collapsed by default
firstExpanded - User can collapse/expand panels. The first panel is expanded and others are collapsed
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- default
- Accepted values:
-
default
, collapsed
, expanded
, firstExpanded
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
renderMode *
, templateTitle
|
|
A parent element. It can be panel or page.
- Type:
-
IPanel writable
- Implemented in:
-
Question
|
|
A parent question. It can be a dynamic panel or dynamic/dropdown matrices. If the value is a matrix, it means that question is a cell question.
This property is null for a stand alone question.
- Type:
-
Question readonly
- Implemented in:
-
Question
|
|
Returns the rendred question title.
- Type:
-
string readonly
- Implemented in:
-
Question
|
|
Returns questions count: 1 for the non-matrix questions and all inner visible questions that has input(s) widgets for question of matrix types.
- Type:
-
number readonly
- Implemented in:
-
Question
- See also:
-
getQuizQuestions
|
|
Set it to true to make an element question/panel/page readonly.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
boolean writable
- Implemented in:
-
SurveyElement
- See also:
-
enableIf *
, isReadOnly
|
|
Register a function that will be called on a property value changed from the names list.
- Type:
-
(names: any, func: any, key?: string) => void
- Parameters:
-
names, type: any
, the list of properties names
func, type: any
, the function with no parameters that will be called on property changed.
key, type: string
, an optional parameter. If there is already a registered function for this property with the same key, it will be overwritten.
- Implemented in:
-
Base
|
|
Register a function that will be called on a property value changed.
- Type:
-
(name: string, func: any, key?: string) => void
- Parameters:
-
name, type: string
, the property name
func, type: any
, the function with no parameters that will be called on property changed.
key, type: string
, an optional parameter. If there is already a registered function for this property with the same key, it will be overwritten.
- Implemented in:
-
Base
|
|
Remove a particular error from the question error list.
- Type:
-
(error: SurveyError) => void
- Parameters:
-
error, type: SurveyError
- Implemented in:
-
Question
|
|
Removes a dynamic panel from the panels array.
- Type:
-
(value: any) => void
- Parameters:
-
value, type: any
, a panel or panel index
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
panels *
, template
|
|
Call removePanel function. Do nothing is canRemovePanel returns false. If confirmDelete set to true, it shows the confirmation dialog first.
- Type:
-
(value: any) => void
- Parameters:
-
value, type: any
, a panel or panel index
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
removePanel *
, confirmDelete *
, confirmDeleteText *
, canRemovePanel *
|
|
By default the property equals to "list" and all dynamic panels are rendered one by one on the page. You may change it to: "progressTop", "progressBottom" or "progressTopBottom" to render only one dynamic panel at once. The progress and navigation elements can be rendred on top, bottom or both.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- list
- Accepted values:
-
list
, progressTop
, progressBottom
, progressTopBottom
- Implemented in:
-
QuestionPanelDynamicModel
|
|
The rendered width of the question.
- Type:
-
string writable
- Implemented in:
-
SurveyElement
|
|
The custom text that will be shown on required error. Use this property, if you do not want to show the default text.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
|
|
An expression that returns true or false. If it returns true the Question becomes required and an end-user has to answer it.
If it returns false the Question then an end-user may not answer it the Question maybe empty.
The library runs the expression on survey start and on changing a question value. If the property is empty then isRequired property is used.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
isRequired
|
|
Returns the char/string for a required question.
- Type:
-
string readonly
- Implemented in:
-
Question
- See also:
-
SurveyModel.requiredText
|
|
The right indent. Set it different from 0 to increase the right padding.
- Type:
-
number writable
- Implemented in:
-
SurveyElement
|
|
Run visibleIf and enableIf expressions. If visibleIf or/and enabledIf are not empty, then the results of performing the expression (true or false) set to the visible/readOnly properties.
- Type:
-
(values: HashTable<any>, properties: HashTable<any>) => void
- Parameters:
-
values, type: HashTable<any>
, Typically survey results
properties, type: HashTable<any>
- Implemented in:
-
Question
- See also:
-
visible *
, visibleIf *
, readOnly *
, enableIf
|
|
- Type:
-
(name: string, val: any) => void
- Parameters:
-
name, type: string
, property name
val, type: any
, new property value
- Implemented in:
-
Base
|
|
Use this property to show/hide the numbers in titles in questions inside a dynamic panel.
By default the value is "off". You may set it to "onPanel" and the first question inside a dynamic panel will start with 1 or "onSurvey" to include nested questions in dymamic panels into global survey question numbering.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- off
- Accepted values:
-
off
, onPanel
, onSurvey
- Implemented in:
-
QuestionPanelDynamicModel
|
|
Shows the range from 1 to panelCount when renderMode doesn't equal to "list". Set to false to hide this element.
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- True
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
panelCount *
, renderMode
|
|
The Question renders on the new line if the property is true. If the property is false, the question tries to render on the same line/row with a previous question/panel.
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- True
- Implemented in:
-
Question
|
|
Set this property to "collapsed" to render only Panel title and expanded button and to "expanded" to render the collapsed button in the Panel caption
- Type:
-
string writable
- Implemented in:
-
SurveyElement
|
|
Returns the survey object.
- Type:
-
ISurvey readonly
- Implemented in:
-
SurveyElement
|
|
The template Panel. This panel is used as a template on creatign dynamic panels
- Type:
-
PanelModel readonly
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
templateElements *
, templateTitle *
, panelCount
|
|
The template Panel description property.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
templateElements *
, template *
, panelCount *
, templateTitle
|
|
The template Panel elements, questions and panels.
- Type:
-
any readonly
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
templateElements *
, template *
, panelCount
|
|
The template Panel title property.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
templateElements *
, template *
, panelCount
|
|
Set this property different from "default" to set the specific question title location for the template questions.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- default
- Accepted values:
-
default
, top
, bottom
, left
- Implemented in:
-
QuestionPanelDynamicModel
- See also:
-
SurveyModel.questionTitleLocation *
, PanelModelBase.questionTitleLocation
|
|
Question, Panel, Page and Survey title. If page and panel is empty then they are not rendered.
Question renders question name if the title is empty. Use survey questionTitleTemplate property to change the title question rendering.
- Type:
-
string writable
- Implemented in:
-
SurveyElementCore
- See also:
-
SurveyModel.questionTitleTemplate
|
|
Set this property different from "default" to set the specific question title location for this panel/page.
Please note, this property is hidden for questions without input, for example html question.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- default
- Accepted values:
-
default
, top
, bottom
, left
, hidden
- Implemented in:
-
Question
- See also:
-
SurveyModel.questionTitleLocation
|
|
- Type:
-
() => boolean
- Implemented in:
-
SurveyElement
- See also:
-
state
|
|
Deserialized the current object into JSON
- Type:
-
() => any
- Implemented in:
-
Base
- See also:
-
fromJSON
|
|
Unregister notification on property value changed for all properties in the names list.
- Type:
-
(names: any, key?: string) => void
- Parameters:
-
names, type: any
, the list of properties names
key, type: string
, the key with which you have registered the notification for this property. It can be null.
- Implemented in:
-
Base
|
|
Unregister notification on property value changed
- Type:
-
(name: string, key?: string) => void
- Parameters:
-
name, type: string
, the property name
key, type: string
, the key with which you have registered the notification for this property. It can be null.
- Implemented in:
-
Base
|
|
Use it to choose how other question values will be rendered in title if referenced in .
Please note, this property is hidden for question without input, for example html question.
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- True
- Implemented in:
-
Question
|
|
The list of question validators.
Please note, this property is hidden for question without input, for example html question.
- Type:
-
any writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
|
|
Get/Set the question value.
- Type:
-
any writable
- Implemented in:
-
Question
- See also:
-
SurveyMode.setValue *
, SurveyMode.getValue
|
|
Use this property if you want to store the question result in the name different from the question name.
Question name should be unique in the survey and valueName could be not unique. It allows to share data between several questions with the same valueName.
The library set the value automatically if the question.name property is not valid. For example, if it contains the period '.' symbol.
In this case if you set the question.name property to 'x.y' then the valueName becomes 'x y'.
Please note, this property is hidden for questions without input, for example html question.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
name
|
|
Use it to get/set the question visibility.
- Type:
-
boolean writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Default value:
- True
- Implemented in:
-
Question
- See also:
-
visibleIf
|
|
An expression that returns true or false. If it returns true the Question becomes visible and if it returns false the Question becomes invisible. The library runs the expression on survey start and on changing a question value. If the property is empty then visible property is used.
- Type:
-
string writable
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
- Implemented in:
-
Question
- See also:
-
visible
|
|
Returns the visible index of the question in the survey. It can be from 0 to all visible questions count - 1
The visibleIndex is -1 if the title is 'hidden' or hideNumber is true
- Type:
-
number readonly
- Implemented in:
-
Question
- See also:
-
titleLocation *
, hideNumber
|
|
Use it to set the specific width to the survey element like css style (%, px, em etc).
- Type:
-
string writable
- Implemented in:
-
SurveyElement
|