|
Add an element into Panel or Page. Returns true if the element added successfully. Otherwise returns false.
- Type:
-
(element: IElement, index?: number) => boolean
- Parameters:
-
element, type: IElement
index, type: number
, element index in the elements array
- Implemented in:
-
PanelModelBase
|
|
Creates a new panel and adds it into the end of the elements list. Returns null, if the panel could not be created or could not be added into page or panel.
- Type:
-
(name?: string) => PanelModel
- Parameters:
-
name, type: string
, a panel name
- Implemented in:
-
PanelModelBase
|
|
Creates a new question and adds it at location of index, by default the end of the elements list. Returns null, if the question could not be created or could not be added into page or panel.
- Type:
-
(questionType: string, name?: string, index?: number) => Question
- Parameters:
-
questionType, type: string
, the possible values are: "text", "checkbox", "dropdown", "matrix", "html", "matrixdynamic", "matrixdropdown" and so on.
name, type: string
, a question name
index, type: number
, element index in the elements array
- Implemented in:
-
PanelModelBase
|
|
Add a panel into Panel or Page. Returns true if the panel added successfully. Otherwise returns false.
- Type:
-
(panel: PanelModel, index?: number) => boolean
- Parameters:
-
panel, type: PanelModel
index, type: number
, element index in the elements array
- Implemented in:
-
PanelModelBase
|
|
Fill list array with the panels.
- Type:
-
(list: IPanel[], visibleOnly?: boolean, includingDesignTime?: boolean) => void
- Parameters:
-
list, type: IPanel[]
visibleOnly, type: boolean
includingDesignTime, type: boolean
- Implemented in:
-
PanelModelBase
|
|
Add a question into Panel or Page. Returns true if the question added successfully. Otherwise returns false.
- Type:
-
(question: Question, index?: number) => boolean
- Parameters:
-
question, type: Question
index, type: number
, element index in the elements array
- Implemented in:
-
PanelModelBase
|
|
Fill list array with the questions.
- Type:
-
(list: IQuestion[], visibleOnly?: boolean, includingDesignTime?: boolean) => void
- Parameters:
-
list, type: IQuestion[]
visibleOnly, type: boolean
, set it to true to get visible questions only
includingDesignTime, type: boolean
- Implemented in:
-
PanelModelBase
|
|
areQuestionsRandomized
property
|
|
The property returns true, if the elements are randomized on the page
- Type:
-
boolean readonly
- Implemented in:
-
PageModel
- See also:
-
hasShown *
, questionsOrder *
, SurveyModel.questionsOrder
|
|
Call this function to clear all errors in the panel / page and all its child elements (panels and questions)
- Type:
-
() => void
- Implemented in:
-
PanelModelBase
|
|
Call this function to remove all question values from the current page/panel, 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.
Please note, this function doesn't clear values for invisible questions or values that doesn't associated with questions.
- Type:
-
() => void
- Implemented in:
-
PanelModelBase
- See also:
-
Question.clearIncorrectValues
|
|
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
|
|
Returns true if the current element belongs to the Panel/Page. It looks in nested Panels as well.
- Type:
-
(element: IElement) => boolean
- Parameters:
-
element, type: IElement
- Implemented in:
-
PanelModelBase
- See also:
-
PanelModel
|
|
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
|
|
PanelModel or PageModel description property. It renders under title by using smaller font. Unlike the title, description can be empty.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PanelModelBase
- See also:
-
title
|
|
Returns the list of the elements in the object, Panel/Page. Elements can be questions or panels. The function doesn't return elements in the nested Panels.
- Type:
-
IElement[] readonly
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PanelModelBase
|
|
An expression that returns true or false. If it returns false the Panel/Page becomes read only and an end-user will not able to answer on qustions inside it.
The library runs the expression on survey start and on changing a question value. If the property is empty then readOnly property is used.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PanelModelBase
- See also:
-
readOnly *
, isReadOnly
|
|
The list of errors. It is created by callig hasErrors functions
- Type:
-
SurveyError[] writable
- Implemented in:
-
SurveyElement
- See also:
-
hasErrors
|
|
expand
method
|
|
- Type:
-
() => void
- Implemented in:
-
SurveyElement
- See also:
-
state
|
|
Call it to focus the input of the first question that has an error.
- Type:
-
() => void
- Implemented in:
-
PanelModelBase
|
|
Call it to focus the input on the first question
- Type:
-
() => void
- Implemented in:
-
PanelModelBase
|
|
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
|
|
Return questions values as a JSON object with display text. For example, for dropdown, it would return the item text instead of item value.
- Type:
-
(keysAsText: boolean) => any
- Parameters:
-
keysAsText, type: boolean
, Set this value to true, to return key (in matrices questions) as display text as well.
- Implemented in:
-
PanelModelBase
|
|
Returns the element by its name. It works recursively.
- Type:
-
(name: string) => IElement
- Parameters:
-
name, type: string
, the element name
- Implemented in:
-
PanelModelBase
|
|
Returns the list of all panels in the page
- Type:
-
(visibleOnly?: boolean, includingDesignTime?: boolean) => IPanel[]
- Parameters:
-
visibleOnly, type: boolean
includingDesignTime, type: boolean
- Implemented in:
-
PageModel
|
|
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 question by its name
- Type:
-
(name: string) => Question
- Parameters:
-
name, type: string
, the question name
- Implemented in:
-
PanelModelBase
|
|
Returns the element template name without prefix. Typically it equals to getType().
- Type:
-
() => string
- Implemented in:
-
Base
- See also:
-
getType
|
|
Returns the type of the object as a string as it represents in the json. It should be in lowcase.
- Type:
-
() => string
- Implemented in:
-
Base
|
|
Returns the type of the object as a string as it represents in the json. It should be in lowcase.
- Type:
-
() => string
- Implemented in:
-
PanelModelBase
|
|
Returns question values on the current page
- Type:
-
() => any
- Implemented in:
-
PanelModelBase
|
|
Returns true, if there is an error on this Page or inside the current Panel
- Type:
-
(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any) => boolean
- Parameters:
-
fireCallback, type: boolean
, set it to true, to show errors in UI
focusOnFirstError, type: boolean
, set it to true to focus on the first question that doesn't pass the validation
rec, type: any
- Implemented in:
-
PanelModelBase
|
|
A unique element identificator. It is generated automatically.
- Type:
-
string writable
- Implemented in:
-
PanelModelBase
|
|
Returns the index of element parameter in the elements list.
- Type:
-
(element: IElement) => number
- Parameters:
-
element, type: IElement
, question or panel
- Implemented in:
-
PanelModelBase
|
|
Returns true if the object is inluded into survey, otherwise returns false.
- Type:
-
boolean readonly
- Implemented in:
-
Base
|
|
Returns true if the current object is Page and it is the current page.
- Type:
-
boolean readonly
- Implemented in:
-
PanelModelBase
|
|
Returns true if the Element is in the collapsed state
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
- See also:
-
state *
, collapse *
, isExpanded
|
|
Returns true if the question in design mode right now.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
|
|
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
|
|
Return false if it is not panel.
- Type:
-
boolean readonly
- Implemented in:
-
SurveyElement
|
|
Returns true if the current object is Panel. Returns false if the current object is Page (a root Panel).
- Type:
-
boolean readonly
- Implemented in:
-
PanelModelBase
|
|
Returns true if readOnly property is true or survey is in display mode or parent panel/page is readOnly.
- Type:
-
boolean readonly
- Implemented in:
-
PanelModelBase
- See also:
-
SurveyModel.model *
, readOnly
|
|
Set this property to true, to require the answer at least in one question in the panel.
- Type:
-
boolean writable
- Implemented in:
-
PanelModelBase
|
|
Returns true, if the page is started page in the survey. It can be shown on the start only and the end-user could not comeback to it after it passed it.
- Type:
-
boolean readonly
- Implemented in:
-
PageModel
|
|
Returns true if a value underfined, 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 object is visible or survey is in design mode right now.
- Type:
-
boolean readonly
- Implemented in:
-
PanelModelBase
|
|
The maximum time in seconds that end-user has to complete the page. If the value is 0 or less, the end-user has unlimited number of time to finish the page.
- Type:
-
number writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PageModel
- See also:
-
startTimer *
, SurveyModel.maxTimeToFinishPage
|
|
This is the identifier of a survey element - question or panel.
- Type:
-
string writable
- Implemented in:
-
SurveyElement
- See also:
-
valueName
|
|
Set this property to "hide" to make "Prev", "Next" and "Complete" buttons are invisible for this page. Set this property to "show" to make these buttons visible, even if survey showNavigationButtons property is false.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- The default value is:
- inherit
- You may set the following values into this property:
-
inherit
, show
, hide
- Implemented in:
-
PageModel
- See also:
-
SurveyMode.showNavigationButtons
|
|
Use this property to show title in navigation buttons. If the value is empty then page name is used.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PageModel
- See also:
-
survey.progressBarType
|
|
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
|
|
A parent element. It is always null for the Page object and always not null for the Panel object. Panel object may contain Questions and other Panels.
- Type:
-
PanelModelBase writable
- Implemented in:
-
PanelModelBase
|
|
Returns rendered title text or html.
- Type:
-
string readonly
- Implemented in:
-
PanelModelBase
|
|
Returns the list of all questions located in the Panel/Page, including in the nested Panels.
- Type:
-
Question[] readonly
- Implemented in:
-
PanelModelBase
- See also:
-
Question *
, elements
|
|
Use this property to randomize questions. Set it to 'random' to randomize questions, 'initial' to keep them in the same order or 'default' to use the Survey questionsOrder property
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- The default value is:
- default
- You may set the following values into this property:
-
default
, initial
, random
- Implemented in:
-
PageModel
- See also:
-
SurveyModel.questionsOrder *
, areQuestionsRandomized
|
|
Set this property different from "default" to set the specific question title location for this panel/page.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- The default value is:
- default
- You may set the following values into this property:
-
default
, top
, bottom
, left
, hidden
- Implemented in:
-
PanelModelBase
- See also:
-
SurveyModel.questionTitleLocation
|
|
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: string[], func: any, key?: string) => void
- Parameters:
-
names, type: string[]
, 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 an element (Panel or Question) from the elements list.
- Type:
-
(element: IElement) => boolean
- Parameters:
-
element, type: IElement
- Implemented in:
-
PanelModelBase
- See also:
-
elements
|
|
Remove question from the elements list.
- Type:
-
(question: Question) => void
- Parameters:
-
question, type: Question
- Implemented in:
-
PanelModelBase
- See also:
-
elements *
, removeElement
|
|
The custom text that will be shown on required error. Use this property, if you do not want to show the default text.
- Type:
-
string writable
- Implemented in:
-
PanelModelBase
|
|
An expression that returns true or false. If it returns true the Panel/Page becomes required.
The library runs the expression on survey start and on changing a question value. If the property is empty then isRequired property is used.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PanelModelBase
- See also:
-
isRequired
|
|
Returns the char/string for a required panel.
- Type:
-
string readonly
- Implemented in:
-
PanelModelBase
- See also:
-
SurveyModel.requiredText
|
|
Call it to scroll to the page top.
- Type:
-
() => void
- Implemented in:
-
PageModel
|
|
- Type:
-
(name: string, val: any) => void
- Parameters:
-
name, type: string
, property name
val, type: any
, new property value
- Implemented in:
-
Base
|
|
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
|
|
Time in seconds end-user spent on this page
- Type:
-
number readonly
- Implemented in:
-
PageModel
|
|
PanelModel or PageModel title property.
- Type:
-
string writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PanelModelBase
|
|
- Type:
-
() => void
- 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: string[], key?: string) => void
- Parameters:
-
names, type: string[]
, 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 get/set the object visibility.
- Type:
-
boolean writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- The default value is:
- True
- Implemented in:
-
PanelModelBase
- See also:
-
visibleIf
|
|
An expression that returns true or false. If it returns true the Panel becomes visible and if it returns false the Panel 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
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
- Implemented in:
-
PanelModelBase
- See also:
-
visible
|
|
The visible index of the page. It has values from 0 to visible page count - 1.
- Type:
-
number writable
- Implemented in:
-
PageModel
- See also:
-
SurveyModel.visiblePages *
, SurveyModel.pages
|
|
The property returns true, if the page has been shown to the end-user.
- Type:
-
boolean readonly
- Implemented in:
-
PageModel
|