SurveyModel
Survey object contains information about the survey. Pages, Questions, flow logic and etc.
Inherited from the following class(es) Base
Type to filter the list:
Survey object contains information about the survey. Pages, Questions, flow logic and etc.
Inherited from the following class(es) Base
Type to filter the list:
|
addNewPage method | |
Creates a new page and adds it into the survey. Genarates a new name if the name parameter is not set.
Type:
(name?: string) => PageModel
Parameters:
name, type: string , a page name
Implemented in:
SurveyModel
See also:
addPage
|
||
|
addPage method | |
Add a page into the survey
Type:
(page: PageModel) => void
Parameters:
page, type: PageModel
Implemented in:
SurveyModel
See also:
addNewPage
|
||
|
checkErrorsMode property | |
Change this property from 'onNextPage' to 'onValueChanged' to check erorrs on every question value changing.
By default, library checks errors on changing current page to the next or on completing the survey.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
clear method | |
Clear the survey data and state. If the survey has a 'completed' state, it will have a 'running' state.
Type:
(clearData?: boolean, gotoFirstPage?: boolean) => void
Parameters:
clearData, type: boolean , clear the data gotoFirstPage, type: boolean , make the first page as a current page.
Implemented in:
SurveyModel
|
||
|
clearFiles method | |
Clear files from server
Type:
(name: string, value: any, fileName: string, callback: (status: string, data: any) => any) => void
Parameters:
name, type: string , question name value, type: any , file question value fileName, type: string callback, type: (status: string, data: any) => any , a call back function to get the status of the clearing operation
Implemented in:
SurveyModel
|
||
|
clearIncorrectValues method | |
Call this function to remove all question values from the survey, 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.
In fact this function just call clearIncorrectValues function of all questions in the survery
Type:
() => void
Implemented in:
SurveyModel
|
||
|
clearInvisibleValues property | |
Set it to 'none' to include the invisible values into the survey data.
Set it to 'onHidden' to clear the question value when it becomes invisible.
Leave it equals to 'onComplete', to remove from data property values of invisible questions on survey complete. In this case, the invisible questions will not be stored on the server.
The default value is 'onComplete'.
Type:
any
writable
Implemented in:
SurveyModel
|
||
|
clearValue method | |
Remove the value from the survey result.
Type:
(name: string) => void
Parameters:
name, type: string , The name of the value. Typically it is a question name
Implemented in:
SurveyModel
|
||
|
clearValueOnDisableItems property | |
Set this value to true, to clear value on disable items in checkbox, dropdown and radiogroup questions.
By default values are not cleared on disabled the corresponded items. This property is not persisted in survey json and you have to set it in code.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
clientId property | |
Use this property as indentificator for a user, for example e-mail or unique customer id in your web application. If you are loading survey or posting survey results from/to [dxsurvey.com](http://www.dxsurvey.com) service, then the library do not allow to run the same survey the second time. On the second run, the user will see the 'Thank you' page.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
commentPrefix property | |
You may show comments input for the most of questions. The entered text in the comment input will be saved as 'question name' + 'commentPrefix'.
Type:
string
writable
Implemented in:
SurveyModel
See also:
data
|
||
|
comments property | |
Returns all comments from the data.
Type:
any
readonly
Implemented in:
SurveyModel
See also:
data
|
||
|
completedBeforeHtml property | |
The html that shows if the end user has already completed the survey.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
completedHtml property | |
The html that shows on completed ('Thank you') page. Set it to change the default text.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
completeLastPage method | |
Call it to complete the survey, if the current page is the last one. It returns false if there is an error on the page. If there is no errors on the page, it calls doComplete and returns true.
Type:
() => boolean
Implemented in:
SurveyModel
|
||
|
completeText property | |
A text that renders on the 'Complete' button. Set it to change the default text.
Type:
string
writable
Implemented in:
SurveyModel
See also:
locale
|
||
|
cookieName property | |
If the property is not empty, before starting to run the survey, the library checkes if the cookie with this name exists. If it is true, the survey goes to complete mode and an user sees the 'Thank you' page. On completing the survey the cookie with this name is created.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
currentPage property | |
Returns the current survey page. If survey is rendred then it is a page that a user can see/edit.
Type:
any
writable
Implemented in:
SurveyModel
|
||
|
currentPageNo property | |
The index of the current page in the visible pages array. It starts from 0.
Type:
number
writable
Implemented in:
SurveyModel
|
||
|
data property | |
An object that stores the survey results/data. You may set it directly as { 'question name': questionValue, ... }
Type:
any
writable
Implemented in:
SurveyModel
|
||
|
deleteCookie method | |
Delete the cookie with cookieName in the browser.
Type:
() => void
Implemented in:
SurveyModel
|
||
|
doComplete method | |
Call it to complete the survey. It writes cookie if cookieName property is not empty, set the survey into 'completed' state, fire onComplete event and sendResult into [dxsurvey.com](http://www.dxsurvey.com) service if surveyPostId property is not empty. It doesn't perform any validation, unlike completeLastPage function.
Type:
() => void
Implemented in:
SurveyModel
|
||
|
downloadFile method | |
Download the file from server
Type:
(questionName: string, fileValue: any, callback: (status: string, data: any) => any) => void
Parameters:
questionName, type: string fileValue, type: any , single file question value callback, type: (status: string, data: any) => any , a call back function to get the status on downloading the file and the downloaded file content
Implemented in:
SurveyModel
|
||
|
emptySurveyText property | |
Returns the text that renders when there is no any visible page and question.
Type:
string
readonly
Implemented in:
SurveyModel
|
||
|
firstPageIsStarted property | |
Set this property to true, to make the first page your starting page. The end-user could not comeback to the start page and it is not count in the progress.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
focusFirstQuestion method | |
Set the input focus to the first question with the input.
Type:
() => void
Implemented in:
SurveyModel
|
||
|
focusFirstQuestionAutomatic property | |
On showing the next or previous page, a first input is focused, if the property set to true.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
getAllPanels method | |
Returns the list of all panels in the survey
Type:
(visibleOnly?: boolean, includingDesignTime?: boolean) => IPanel[]
Parameters:
visibleOnly, type: boolean includingDesignTime, type: boolean
Implemented in:
SurveyModel
|
||
|
getAllQuestions method | |
Returns the list of all questions in the survey
Type:
(visibleOnly?: boolean, includingDesignTime?: boolean) => IQuestion[]
Parameters:
visibleOnly, type: boolean , set it true, if you want to get only visible questions includingDesignTime, type: boolean
Implemented in:
SurveyModel
|
||
|
getComment method | |
Returns the comment value
Type:
(name: string) => string
Parameters:
name, type: string
Implemented in:
SurveyModel
See also:
setComment
|
||
|
getCorrectedAnswerCount method | |
Returns the number of corrected answers on quiz
Type:
() => number
Implemented in:
SurveyModel
|
||
|
getInCorrectedAnswerCount method | |
Returns the number of incorrected answers on quiz
Type:
() => number
Implemented in:
SurveyModel
|
||
|
getPageByElement method | |
Returns a page on which an element (question or panel) is placed.
Type:
(element: IElement) => PageModel
Parameters:
element, type: IElement , Question or Panel
Implemented in:
SurveyModel
|
||
|
getPageByName method | |
Returns a page by it's name.
Type:
(name: string) => PageModel
Parameters:
name, type: string
Implemented in:
SurveyModel
|
||
|
getPageByQuestion method | |
Returns a page on which a question is located
Type:
(question: IQuestion) => PageModel
Parameters:
question, type: IQuestion
Implemented in:
SurveyModel
|
||
|
getPagesByNames method | |
Rertuns a list of pages by their names
Type:
(names: string[]) => PageModel[]
Parameters:
names, type: string[] , a list of pages names
Implemented in:
SurveyModel
|
||
|
getPanelByName method | |
Returns a panel by its name
Type:
(name: string, caseInsensitive?: boolean) => IPanel
Parameters:
name, type: string , a panel name caseInsensitive, type: boolean
Implemented in:
SurveyModel
See also:
getQuestionByName
|
||
|
getPlainData method | |
Returns survey result data as an array of plain objects: 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; }) => any[]
Parameters:
options, type: { includeEmpty?: boolean; }
Implemented in:
SurveyModel
|
||
|
getProgress method | |
Returns the progress that a user made by answering on the survey.
Type:
() => number
Implemented in:
SurveyModel
|
||
|
getPropertyValue method | |
Returns the property value by name
Type:
(name: string, defaultValue?: any) => any
Parameters:
name, type: string , property name defaultValue, type: any
Implemented in:
Base
|
||
|
getQuestionByName method | |
Returns a question by its name
Type:
(name: string, caseInsensitive?: boolean) => IQuestion
Parameters:
name, type: string , a question name caseInsensitive, type: boolean
Implemented in:
SurveyModel
See also:
getQuestionByValueName
|
||
|
getQuestionByValueName method | |
Returns a question by its value name
Type:
(valueName: string, caseInsensitive?: boolean) => IQuestion
Parameters:
valueName, type: string , a question name caseInsensitive, type: boolean
Implemented in:
SurveyModel
|
||
|
getQuestionsByNames method | |
Get a list of questions by their names
Type:
(names: string[], caseInsensitive?: boolean) => IQuestion[]
Parameters:
names, type: string[] , the array of names caseInsensitive, type: boolean
Implemented in:
SurveyModel
|
||
|
getQuestionTitleTemplate method | |
Returns the question title template
Type:
() => string
Implemented in:
SurveyModel
|
||
|
getQuizQuestions method | |
Returns quiz questions. All visible questions that has input(s) widgets.
Type:
() => IQuestion[]
Implemented in:
SurveyModel
|
||
|
getResult method | |
It calls the [dxsurvey.com](http://www.dxsurvey.com) service and on callback fires onGetResult event with all answers that your users made for a question.
Type:
(resultId: string, name: string) => void
Parameters:
resultId, type: string , [dxsurvey.com](http://www.dxsurvey.com) service resultId name, type: string , The question name
Implemented in:
SurveyModel
See also:
onGetResult
|
||
|
getTemplate method | |
Returns the element template name without prefix. Typically it equals to getType()
Type:
() => string
Implemented in:
Base
See also:
getType
|
||
|
getType method | |
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
|
||
|
getValue method | |
Returns a question value
Type:
(name: string) => any
Parameters:
name, type: string , A question name
Implemented in:
SurveyModel
|
||
|
getVariable method | |
Returns a variable value. Variable, unlike values, are not stored in the survey results.
Type:
(name: string) => any
Parameters:
name, type: string , A variable name
Implemented in:
SurveyModel
See also:
SetVariable
|
||
|
goNextPageAutomatic property | |
Set it to the one of the following constants if you want to go to the next page without pressing 'Next' button when all questions are anwered.
true - go next page and submit automatically
"autogonext" - go next page automatically but do not submit
false - do not go next page and not submit automatically
Type:
boolean | "autogonext"
writable
Implemented in:
SurveyModel
See also:
showNavigationButtons
|
||
|
hasCookie property | |
Returns true, if a user has already completed the survey on this browser and there is a cookie about it. Survey goes to 'completed' state if the function returns true.
Type:
boolean
readonly
Implemented in:
SurveyModel
|
||
|
isCurrentPageHasErrors property | |
Returns true, if there is any error on the current page. For example, the required question is empty or a question validation is failed.
Type:
boolean
readonly
Implemented in:
SurveyModel
See also:
nextPage
|
||
|
isDesignMode property | |
Returns true if the survey in the design mode. It is used by SurveyJS Editor
Type:
boolean
readonly
Implemented in:
SurveyModel
See also:
setDesignMode
|
||
|
isDisplayMode property | |
Returns true if the survey in the display mode.
Type:
boolean
readonly
Implemented in:
SurveyModel
See also:
mode
|
||
|
isEditMode property | |
Returns true if the survey in the edit mode.
Type:
boolean
readonly
Implemented in:
SurveyModel
See also:
mode
|
||
|
isEmpty property | |
Returns true if there is no any page in the survey. The survey is empty.
Type:
boolean
readonly
Implemented in:
SurveyModel
|
||
|
isFirstPage property | |
Returns true if the current page is the first one.
Type:
boolean
readonly
Implemented in:
SurveyModel
|
||
|
isLastPage property | |
Returns true if the current page is the last one.
Type:
boolean
readonly
Implemented in:
SurveyModel
|
||
|
isLoadingFromJson property | |
Returns true if the object is loading from Json at the current moment.
Type:
boolean
readonly
Implemented in:
Base
|
||
|
isNavigationButtonsShowing property | |
Returns true if navigation buttons: 'Prev', 'Next' or 'Complete' are shown.
Type:
boolean
readonly
Implemented in:
SurveyModel
|
||
|
isSinglePage property | |
Set this property to true, if you want to combine all your pages in one page. Pages will be converted into panels.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
isValidatingOnServer property | |
Returns true, if at the current moment the question values on the current page are validating on the server.
Type:
boolean
readonly
Implemented in:
SurveyModel
See also:
onServerValidateQuestions
|
||
|
isValueEmpty method | |
A static methods that returns true if a value underfined, null, empty string or empty array.
Type:
(value: any) => boolean
Parameters:
value, type: any
Implemented in:
Base
|
||
|
jsonErrors property | |
The list of errors on loading survey json. If the list is empty after loading a json then the json is correct and there is no errors in it.
Type:
JsonError[]
readonly
Implemented in:
SurveyModel
See also:
JsonError
|
||
|
loadingHtml property | |
The html that shows on loading survey Json from the dxsurvey.com service.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
loadSurveyFromService method | |
Loads the survey Json from the [dxsurvey.com](http://www.dxsurvey.com) service. If clientId is not null and user has already completed the survey, the survey will go into "completedbefore" state.
Type:
(surveyId?: string, cliendId?: string) => void
Parameters:
surveyId, type: string , [dxsurvey.com](http://www.dxsurvey.com) service surveyId cliendId, type: string
Implemented in:
SurveyModel
See also:
state
|
||
|
locale property | |
Use it to change the survey locale. By default it is empty, 'en'. You may set it to 'de' - german, 'fr' - french and so on. The library has built-in localization for several languages. The library has a multi-language support as well.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
maxOthersLength property | |
The default maximum length for question comments and others
The default value is 0, it is unlimited maxLength - 524288 characters: https://www.w3schools.com/tags/att_input_maxlength.asp
Type:
number
writable
Implemented in:
SurveyModel
|
||
|
maxTextLength property | |
The default maximum length for questions like text and comment, including matrix cell questions.
The default value is 0, it is unlimited maxLength - 524288 characters: https://www.w3schools.com/tags/att_input_maxlength.asp
Type:
number
writable
Implemented in:
SurveyModel
See also:
maxOthersLength
|
||
|
maxTimeToFinish property | |
The maximum time in seconds that end-user has to complete the survey. If the value is 0 or less, the end-user has unlimited number of time to finish the survey.
Type:
number
writable
Implemented in:
SurveyModel
|
||
|
maxTimeToFinishPage property | |
The maximum time in seconds that end-user has to complete a page in the survey. If the value is 0 or less, the end-user has unlimited time. You may override this value for every page.
Type:
number
writable
Implemented in:
SurveyModel
|
||
|
mode property | |
Set this mode to 'display' to make the survey read-only. The default value is 'edit'.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
nextPage method | |
Call it to go to the next page. It returns false, if it is the last page. If there is an error, for example required question is empty, the function returns false as well.
Type:
() => boolean
Implemented in:
SurveyModel
|
||
|
onAfterRenderPage event | |
The event is fired right after a page is rendred in DOM. Use it to modify html elements. There are two parameters in options: options.currentPage, options.htmlElement
sender the survey object that fires the event options.page a page object for which the event is fired. Typically the current/active page. options.htmlElement an html element binded with the page object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onAfterRenderPanel event | |
The event is fired right after a panel is rendred in DOM. Use it to modify html elements. There are two parameters in options: options.panel, options.htmlElement
sender the survey object that fires the event options.panel a panel object for which the event is fired options.htmlElement an html element binded with the panel object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onAfterRenderQuestion event | |
The event is fired right after a question is rendred in DOM. Use it to modify html elements. There are two parameters in options: options.question, options.htmlElement
sender the survey object that fires the event options.question a question object for which the event is fired options.htmlElement an html element binded with the question object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onAfterRenderSurvey event | |
The event is fired right after survey is rendered in DOM. options.htmlElement is the root element.
sender the survey object that fires the event options.htmlElement a root html element binded with the survey object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onClearFiles event | |
The event is fired on clearing the value in QuestionFile. You may use it to remove files stored on your server. There are three properties in options: options.name, options.value and options.callback.
sender the survey object that fires the event name: name, value: value name the question name value the question value fileName of the removed file, pass null to clear all files callback a call back function to get the status on clearing the files operation
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
clearFiles
|
||
|
onComplete event | |
The event is fired after a user click on 'Complete' button and finished the survey. You may use it to send the data to your web server.
sender the survey object that fires the event options.showDataSaving(text) call this method to show that the survey is saving the data on your server. The text is an optional parameter to show your message instead of default. options.showDataSavingError(text) call this method to show that there is an error on saving the data on your server. If you want to show a custom error, use an optional text parameter. options.showDataSavingSuccess(text) call this method to show that the data were successful saved on the server. options.showDataSavingClear call this method to hide the text about the saving progress.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onCompleting event | |
The event is fired before the survey is completed and onComplete event is fired. You may prevent the survey from completing by setting options.allowComplete to false
sender the survey object that fires the event options.allowComplete set it false to prevent the survey from completing. The default value is true.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
onComplete
|
||
|
onCurrentPageChanged event | |
The event is fired when another page becomes the current. Typically it happens when a user click on 'Next' or 'Prev' buttons.
sender the survey object that fires the event option.oldCurrentPage the previous current/active page option.newCurrentPage a new current/active page
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
currentPage
, currentPageNo
, nextPage
, prevPage
, completeLastPage
, onCurrentPageChanging
|
||
|
onCurrentPageChanging event | |
The event is fired before another page becomes the current. Typically it happens when a user click on 'Next' or 'Prev' buttons.
sender the survey object that fires the event option.oldCurrentPage the previous current/active page option.newCurrentPage a new current/active page option.allowChanging set it to false to disable the current page changing. It is true by default.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
currentPage
, currentPageNo
, nextPage
, prevPage
, completeLastPage
, onCurrentPageChanged
|
||
|
onDownloadFile event | |
The event is fired on downloading the file in QuestionFile. You may use it to pass the file for the preview. There are four properties in options: options.name, options.content, optins.fileValue and options.callback.
sender the survey object that fires the event name: name, content: content, fileValue: fileValue name the question name content the file content fileValue single file question value callback a call back function to get the status on downloading the file and the downloaded file content
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
downloadFile
|
||
|
onDragDropAllow event | |
Use this event to control drag&drop operations during design mode.
sender the survey object that fires the event. options.allow set it to false to disable dragging. options.target a target element that is dragging. options.source a source element. It can be null, if it is a new element, dragging from toolbox. options.parent a page or panel where target element is dragging. options.insertBefore an element before the target element is dragging. It can be null if parent container (page or panel) is empty or dragging an element under the last element of the container. options.insertAfter an element after the target element is dragging. It can be null if parent container (page or panel) is empty or dragging element to the top of the parent container.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onDynamicPanelAdded event | |
The event is fired on adding a new panel in Panel Dynamic question.
sender the survey object that fires the event options.question a panel question.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onDynamicPanelItemValueChanged event | |
The event is fired when item value is changed in Panel Dynamic question.
options.question - the panel question options.panel - the dynamic panel item options.name - the item name options.value - a new value options.itemIndex - the panel item index options.itemValue - the panel item object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onDynamicPanelRemoved event | |
The event is fired on removing a panel from Panel Dynamic question.
sender the survey object that fires the event options.question a panel question. options.panelIndex a removed panel index.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onErrorCustomText event | |
Use the event to change the default error text.
sender the survey object that fires the event options.text an error text options.error an instance of SurveyError object options.name the error name. The following error name are available: required, requireoneanswer, requirenumeric, exceedsize, webrequest, webrequestempty, otherempty, uploadingfile, requiredinallrowserror, minrowcounterror, keyduplicationerror, custom
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onGetQuestionTitle event | |
Use this event to change the question title in the code.
sender the survey object that fires the event options.title a calcualted question title, based on question title, name, isRequired, visibleIndex (no) options.question a question object.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onGetResult event | |
Use it to get results after calling the getResult method. It returns a simple analytic from [dxsurvey.com](http://www.dxsurvey.com) service.
sender the survey object that fires the event options.success it is true if the results were got from the service successful options.data the object {AnswersCount, QuestionResult : {} }. AnswersCount is the number of posted survey results. QuestionResult is an object with all possible unique answers to the question and number of these answers. options.dataList an array of objects {name, value}, where 'name' is an unique value/answer to the question and value is a number/count of such answers. options.response the server response
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
getResult
|
||
|
onIsAnswerCorrect event | |
Use this event to define, if the answer on the question is correct or not.
sender the survey object that fires the event options.question a question on which you have to decide if the answer is correct or not. options.result return true, if the answer is correct or false if the answer is not correct. Use questions value and correctAnswer properties to return the correct value.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onLoadChoicesFromServer event | |
The event is fired after choices for radiogroup, checkbox and dropdown has been loaded from the RESTful service and before they are assign to the question.
You may change the choices, before it was assign or disable/enabled make visible/invisible question, based on loaded results
question - the question where loaded choices are going to be assigned choices - the loaded choices. You may change them to assign the correct one serverResult - a result that comes from the server as it is.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixAfterCellRender event | |
The event is fired for every cell after is has been rendered in DOM.
options.question - the matrix question options.cell - the matrix cell options.cellQuestion - the question/editor in the cell. options.htmlElement a html element binded with the cellQuestion object options.column - the matrix column object options.row - the matrix row object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixBeforeRowAdded event | |
The event is fired before adding a new row in Matrix Dynamic question.
sender the survey object that fires the event options.question a matrix question. options.canAddRow an allowing flag.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixCellCreated event | |
The event is fired for every cell created in Matrix Dymic and Matrix Dropdown questions.
options.question - the matrix question options.cell - the matrix cell options.cellQuestion - the question/editor in the cell. You may customize it, change it's properties, like choices or visible. options.rowValue - the value of the current row. To access the value of paticular column use: options.rowValue["columnValue"] options.column - the matrix column object options.columName - the matrix column name options.row - the matrix row object
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixCellValidate event | |
The event is fired when Matrix Dymic and Matrix Dropdown questions validate the cell value.
options.question - the matrix question options.columName - the matrix column name options.value - a cell value options.row - the matrix row object options.getCellQuestion(columnName) - the function that returns the cell question by column name.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixCellValueChanged event | |
The event is fired when cell value is changed in Matrix Dymic and Matrix Dropdown questions.
options.question - the matrix question options.columName - the matrix column name options.value - a new value options.row - the matrix row object options.getCellQuestion(columnName) - the function that returns the cell question by column name.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixRowAdded event | |
The event is fired on adding a new row in Matrix Dynamic question.
sender the survey object that fires the event options.question a matrix question.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onMatrixRowRemoved event | |
The event is fired on removing a row from Matrix Dynamic question.
sender the survey object that fires the event options.question a matrix question. options.rowIndex a removed row index. options.row a removed row object.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onPageAdded event | |
The event is fired on adding a page into survey
sender the survey object that fires the event options.page a newly added panel object.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
PanelModel
|
||
|
onPageVisibleChanged event | |
The event is fired on changing a page visibility.
sender the survey object that fires the event options.page a page which visibility has been changed options.visible a page visible boolean value
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onPanelAdded event | |
The event is fired on adding a panel into survey
sender the survey object that fires the event options.panel a newly added panel object. options.name a panel name options.index a index of the panel in the container (page or panel) options.parentPanel a container where question is located. It can be page or panel. options.rootPanel typically it is a page.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
PanelModel
|
||
|
onPanelRemoved event | |
The event is fired on removing a panel from survey
sender the survey object that fires the event options.panel a removed panel object. options.name a panel name
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
PanelModel
|
||
|
onPanelVisibleChanged event | |
The event is fired on changing a panel visibility.
sender the survey object that fires the event options.panel a panel which visibility has been changed options.visible a panel visible boolean value
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onPartialSend event | |
The event is fired on clicking 'Next' page if sendResultOnPageNext is set to true. You may use it to save the intermediate results, for example, if your survey is large enough.
sender the survey object that fires the event
Type:
Event<(sender: SurveyModel) => any, any>
Implemented in:
SurveyModel
See also:
sendResultOnPageNext
|
||
|
onProcessTextValue event | |
The event is fired on processing the text when it finds a text in brackets: {somevalue}. By default it uses the value of survey question values and variables.
For example, you may use the text processing in loading choices from the web. If your choicesByUrl.url equals to "UrlToServiceToGetAllCities/{country}/{state}",
you may set on this event options.value to "all" or empty string when the "state" value/question is non selected by a user.
name - the name of the processing value, for example, "state" in our example value - the value of the processing text isExists - a boolean value. Set it to true if you want to use the value and set it to false if you don't.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onQuestionAdded event | |
The event is fired on adding a new question into survey.
'question': question, 'name': question.name, 'index': index, 'parentPanel': parentPanel, 'rootPanel': rootPanel
sender the survey object that fires the event options.question a newly added question object. options.name a question name options.index a index of the question in the container (page or panel) options.parentPanel a container where question is located. It can be page or panel. options.rootPanel typically it is a page.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
Question
|
||
|
onQuestionRemoved event | |
The event is fired on removing a question from survey
sender the survey object that fires the event options.question a removed question object. options.name a question name
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
Question
|
||
|
onSendResult event | |
The event fires when it get response from the [dxsurvey.com](http://www.dxsurvey.com) service on saving survey results. Use it to find out if the results have been saved successful.
sender the survey object that fires the event options.success it is true if the results were sent to the service successful options.response a response from the service
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onServerValidateQuestions property | |
Use this event to validate data on your server.
sender the survey object that fires the event options.data the values of all non-empty questions on the current page. You can get a question value as options.data["myQuestionName"]. options.errors set your errors to this object as: options.errors["myQuestionName"] = "Error text";. It will be shown as a question error. options.complete() call this function to tell survey that your server callback has been processed.
Type:
any
readonly
Implemented in:
SurveyModel
|
||
|
onStarted event | |
The event is fired after the survey changed it's state from "starting" to "running". The "starting" state means that survey shows the started page.
The firstPageIsStarted property should be set to the true, if you want to have the started page in your survey. The end-user should click on the "Start" button to start the survey.
Type:
Event<(sender: SurveyModel) => any, any>
Implemented in:
SurveyModel
See also:
firstPageIsStarted
|
||
|
onTextMarkdown event | |
Use this event to process the markdown text.
sender the survey object that fires the event options.element SurveyJS element where the string is going to be rendered. It is a question, panel, page or survey options.text a text that is going to be rendered options.html a html. It is null by default. Set it and survey will use it instead of options.text
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onTimer event | |
The event is fired every second if the method startTimer has been called.
Type:
Event<(sender: SurveyModel) => any, any>
Implemented in:
SurveyModel
|
||
|
onTimerPanelInfoText event | |
The event is fired before displaying a new information in the Timer Panel. Use it to change the default text.
options.text - the timer panel info text.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onUpdatePanelCssClasses event | |
The event is fired before rendering a panel or page. Use it to override the default panel/page css classes.
There are two parameters in options: options.panel and options.cssClasses
sender the survey object that fires the event options.panel a panel for which you may change the css classes options.cssClasses an object with css classes. For example {title: "sv_p_title", description: "small"}. You may change them to your own css classes.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onUpdateQuestionCssClasses event | |
The event is fired before rendering a question. Use it to override the default question css classes.
There are two parameters in options: options.question and options.cssClasses
sender the survey object that fires the event options.question a question for which you may change the css classes options.cssClasses an object with css classes. For example {root: "table", button: "button"}. You may change them to your own css classes.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onUploadFiles event | |
The event is fired on uploading the file in QuestionFile. You may use it to change the file name or tells the library do not accept the file. There are three properties in options: options.name, options.file and options.accept.
sender the survey object that fires the event name: name, file: file, accept: accept name the file name file the Javascript File object accept a boolean value, true by default. Set it to false to deny this file to upload
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
uploadFile
|
||
|
onValidatePanel event | |
Use this event to modify the html before rendering, for example html on 'Thank you' page. Options has one parameter: options.html.
sender the survey object that fires the event options.html an html that you may change before text processing and then rendering. The event is fired on validating a panel. Set your error to options.error and survey will show the error for the panel and block completing the survey or going to the next page. sender the survey object that fires the event options.name a panel name options.error an error string. It is empty by default.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onValidateQuestion event | |
The event is fired on validating value in a question. Set your error to options.error and survey will show the error for the question and block completing the survey or going to the next page.
sender the survey object that fires the event options.question a question options.name a question name options.value the current question value options.error an error string. It is empty by default.
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
See also:
onServerValidateQuestions
|
||
|
onValueChanged event | |
The event is fired when the question value is changed. It can be done via UI by a user or programmatically on calling setValue method.
Please use onDynamicPanelItemValueChanged and onMatrixCellValueChanged events to handle changes a question in the Panel Dynamic and a cell question in matrices.
sender the survey object that fires the event options.name the value name that has been changed options.question a question which question.name equals to the value name. If there are several questions with the same name, the first question is taken. If there is no such questions, the options.question is null. options.value a new value
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onValueChanging event | |
The event is fired before the question value is changed. It can be done via UI by a user or programmatically on calling setValue method.
sender the survey object that fires the event options.name the value name that has being changed options.question a question which question.name equals to the value name. If there are several questions with the same name, the first question is taken. If there is no such questions, the options.question is null. options.value a new value. You may change it
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
onVisibleChanged event | |
The event is fired on changing a question visibility.
sender the survey object that fires the event options.question a question which visibility has been changed options.name a question name options.visible a question visible boolean value
Type:
Event<(sender: SurveyModel, options: any) => any, any>
Implemented in:
SurveyModel
|
||
|
pageCount property | |
Returns the survey pages count.
Type:
number
readonly
Implemented in:
SurveyModel
|
||
|
pageNextText property | |
A text that renders on the 'Next' button. Set it to change the default text.
Type:
string
writable
Implemented in:
SurveyModel
See also:
locale
|
||
|
pagePrevText property | |
A text that renders on the 'Prev' button. Set it to change the default text.
Type:
string
writable
Implemented in:
SurveyModel
See also:
locale
|
||
|
pages property | |
The list of all pages in the survey, including invisible.
Type:
PageModel[]
readonly
Implemented in:
SurveyModel
|
||
|
prevPage method | |
Call it to go to the previous page. It returns false if the current page is the first page already. It doesn't perform any checks, required questions can be empty.
Type:
() => boolean
Implemented in:
SurveyModel
See also:
isFirstPage
|
||
|
processedCompletedBeforeHtml property | |
Returns the html showing that the user has already completed the survey
Type:
string
readonly
Implemented in:
SurveyModel
See also:
completedHtml
|
||
|
processedCompletedHtml property | |
Returns the html for completed 'Thank you' page.
Type:
string
readonly
Implemented in:
SurveyModel
See also:
completedHtml
|
||
|
processedLoadingHtml property | |
Returns the html that shows on loading the json.
Type:
string
readonly
Implemented in:
SurveyModel
|
||
|
processedTitle property | |
Returns the text/html that renders as survey title.
Type:
string
readonly
Implemented in:
SurveyModel
|
||
|
progressText property | |
Returns the text for the current progress.
Type:
string
readonly
Implemented in:
SurveyModel
|
||
|
questionErrorLocation property | |
Set this property to 'bottom' to show question error(s) under the question.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
questionsOrder property | |
Use this property to randomize questions. Set it to 'random' to randomize questions, 'initial' to keep them in the same order. You can randomize questions on a specific page.
Type:
string
writable
Implemented in:
SurveyModel
See also:
SurveyPage.questionsOrder
|
||
|
questionStartIndex property | |
By default the first question index is 1. You may start it from 100 or from 'A', by setting 100 or 'A' to this property.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
questionTitleLocation property | |
Set this property to 'bottom' or 'left' to show question title under the question or on the left.
Note: Some questions, for example matrixes, do not support 'left' value. The title for them will be displayed on the top.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
questionTitleTemplate property | |
A template for a question title.
Type:
string
writable
Implemented in:
SurveyModel
See also:
QuestionModel.title
|
||
|
registerFunctionOnPropertiesValueChanged method | |
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 witht the same key, it will be overwritten.
Implemented in:
Base
|
||
|
registerFunctionOnPropertyValueChanged method | |
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 witht the same key, it will be overwritten.
Implemented in:
Base
|
||
|
removePage method | |
Remove the page from the survey
Type:
(page: PageModel) => void
Parameters:
page, type: PageModel
Implemented in:
SurveyModel
|
||
|
requiredText property | |
A char/string that will be rendered in the title required questions.
Type:
string
writable
Implemented in:
SurveyModel
See also:
Question.title
|
||
|
sendResult method | |
Send the survey result into [dxsurvey.com](http://www.dxsurvey.com) service.
Type:
(postId?: string, clientId?: string, isPartialCompleted?: boolean) => void
Parameters:
postId, type: string , [dxsurvey.com](http://www.dxsurvey.com) service postId clientId, type: string , Typically a customer e-mail or an identificator isPartialCompleted, type: boolean , Set it to true if the survey is not completed yet and it is an intermediate results
Implemented in:
SurveyModel
|
||
|
sendResultOnPageNext property | |
Set it to true, to save results on completing every page. onPartialSend event is fired.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
setComment method | |
Set the comment value
Type:
(name: string, newValue: string) => void
Parameters:
name, type: string newValue, type: string
Implemented in:
SurveyModel
See also:
getComment
|
||
|
setCookie method | |
Set the cookie with cookieName in the browser. It is done automatically on survey complete if cookieName is not empty.
Type:
() => void
Implemented in:
SurveyModel
|
||
|
setDesignMode method | |
Call it to set the survey into the design mode.
Type:
(value: boolean) => void
Parameters:
value, type: boolean , use true to set the survey into the design mode.
Implemented in:
SurveyModel
|
||
|
setPropertyValue method | |
set property value
Type:
(name: string, val: any) => void
Parameters:
name, type: string , property name val, type: any , new property value
Implemented in:
Base
|
||
|
setValue method | |
Sets a question value. It runs all triggers and conditions (visibleIf properties). Goes to the next page if goNextPageAutomatic is true and all questions on the current page are answered correctly.
Type:
(name: string, newValue: any) => void
Parameters:
name, type: string , A question name newValue, type: any
Implemented in:
SurveyModel
|
||
|
setVariable method | |
Sets a variable value. Variable, unlike values, are not stored in the survey results.
Type:
(name: string, newValue: any) => void
Parameters:
name, type: string , A variable name newValue, type: any
Implemented in:
SurveyModel
See also:
GetVariable
|
||
|
showCompletedPage property | |
On finishing the survey the 'Thank you', page on complete, is shown. Set the property to false, to hide the 'Thank you' page.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
showInvisibleElements property | |
Set this property to true, to show all elements in the survey, regardless their visibility. It is false by default.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
showNavigationButtons property | |
Set it to false to hide 'Prev', 'Next' and 'Complete' buttons. It makes sense if you are going to create a custom navigation or have just one page or on setting goNextPageAutomatic property.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
showPageNumbers property | |
Set this property to false to turn off the numbering on pages titles.
Type:
boolean
writable
Implemented in:
SurveyModel
|
||
|
showPageTitles property | |
Set it to false to hide page titles.
Type:
boolean
writable
Implemented in:
SurveyModel
See also:
PageModel.title
|
||
|
showPrevButton property | |
Set it to false to hide the 'Prev' to disable for end-users go back to their answers.
Type:
boolean
writable
Implemented in:
SurveyModel
See also:
showNavigationButtons
|
||
|
showProgressBar property | |
Set this property to "top" to show the progress bar on the bottom or to "bottom" to show it on the bottom.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
showQuestionNumbers property | |
Set this property to "off" to turn off the numbering on questions titles or "onpage" to start numbering on every page. The default value is "on".
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
showTimerPanel property | |
Set it to 'top' or 'bottom' if you want to show the Panel with information about how much time the end-user spent of the survey/page.
If the value doesn't equal 'none' then survey calls startTimer() method on survey rendering.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
showTimerPanelMode property | |
Set this property to 'page' or 'survey' to show the timer information for page or survey only.
Use onTimerPanelInfoText event to change the default text.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
showTitle property | |
Set it to false hide survey title.
Type:
boolean
writable
Implemented in:
SurveyModel
See also:
title
|
||
|
start method | |
Start the survey. Change the mode from "starting" to "running". You need to call it, if there is a started page in your survey, otherwise it does nothing.
Type:
() => void
Implemented in:
SurveyModel
See also:
firstPageIsStarted
|
||
|
startedPage property | |
Returns the started Page. firstPageIsStarted property should be equals to true
Type:
PageModel
readonly
Implemented in:
SurveyModel
See also:
firstPageIsStarted
|
||
|
startSurveyText property | |
A text that renders on the 'Start' button. Set it to change the default text.
The start button is shown on the started page. You have to set firstPageIsStarted property to true, to have the started page.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
startTimer method | |
Call this method to start timer that will calculate how much time end-user spends on the survey or on pages
Type:
() => void
Implemented in:
SurveyModel
|
||
|
state property | |
Returns the current survey state: 'loading' - loading from the json, 'completed' - a user has completed the survey,
'starting' - the started page is showing, running' - a user answers a questions right now, 'empty' - there is nothing to show in the current survey.
Type:
string
readonly
Implemented in:
SurveyModel
|
||
|
stopTimer method | |
Stop the timer.
Type:
() => void
Implemented in:
SurveyModel
|
||
|
storeOthersAsComment property | |
By default the entered text in the others input in the checkbox/radiogroup/dropdown are stored as "question name " + "-Comment". The value itself is "question name": "others". Set this property to false, to store the entered text directly in the "question name" key.
Type:
boolean
writable
Implemented in:
SurveyModel
See also:
commentPrefix
|
||
|
surveyId property | |
Set this property to automatically load survey Json from [dxsurvey.com](http://www.dxsurvey.com) service.
Type:
string
writable
Implemented in:
SurveyModel
See also:
loadSurveyFromService
|
||
|
surveyPostId property | |
Set this property to automatically save the data into the [dxsurvey.com](http://www.dxsurvey.com) service.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
surveyShowDataSaving property | |
Set this property to true, to show the progress on saving/sending data into the [dxsurvey.com](http://www.dxsurvey.com) service.
Type:
boolean
writable
Implemented in:
SurveyModel
See also:
surveyPostId
|
||
|
timeSpent property | |
Returns the time in seconds end-user spends on the survey
Type:
number
writable
Implemented in:
SurveyModel
|
||
|
title property | |
Survey title.
Type:
string
writable
Implemented in:
SurveyModel
|
||
|
toJSON method | |
Deserialized the current object into JSON
Type:
() => any
Implemented in:
Base
|
||
|
triggers property | |
The list of triggers in the survey.
Type:
SurveyTrigger[]
writable
Implemented in:
SurveyModel
See also:
SurveyTrigger
|
||
|
unRegisterFunctionOnPropertiesValueChanged method | |
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
|
||
|
unRegisterFunctionOnPropertyValueChanged method | |
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
|
||
|
uploadFiles method | |
Upload the file into server
Type:
(name: string, files: File[], uploadingCallback: (status: string, data: any) => any) => void
Parameters:
name, type: string , question name files, type: File[] uploadingCallback, type: (status: string, data: any) => any , a call back function to get the status on uploading the file
Implemented in:
SurveyModel
|
||
|
visiblePageCount property | |
Returns the survey visible pages count
Type:
number
readonly
Implemented in:
SurveyModel
|
||
|
visiblePages property | |
Returns the list of visible pages. If all pages are visible then it is the same as pages property.
Type:
PageModel[]
readonly
Implemented in:
SurveyModel
|
This site uses cookies to make your browsing experience more convenient and personal. Cookies store useful information on your computer to help us improve the efficiency and relevance of our site for you. In some cases, they are essential to making the site work properly. By accessing this site, you consent to the use of cookies.
For more information, refer to DevSoft Baltic’ privacy policy and cookie policy.