QuestionCheckboxModel
A Model for a checkbox question
Inherited from the following class(es) QuestionCheckboxBase QuestionSelectBase Question
Type to filter the list:
A Model for a checkbox question
Inherited from the following class(es) QuestionCheckboxBase QuestionSelectBase Question
Type to filter the list:
|
addError method | |
Add error into the question error list.
Type:
(error: SurveyError) => void
Parameters:
error, type: SurveyError
Implemented in:
Question
|
||
|
choices property | |
The list of items. Every item has value and text. If text is empty, the value is rendered. The item text supports markdown.
Type:
any[]
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
The default value is:
[]
Implemented in:
QuestionSelectBase
See also:
choicesByUrl
|
||
|
choicesByUrl property | |
Use this property to fill the choices from a restful service.
Type:
ChoicesRestfull
readonly
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionSelectBase
See also:
choices
|
||
|
choicesEnableIf property | |
An expression that returns true or false. It runs against each choices item and if for this item it returns true, then the item is enabled otherwise the item becomes disabled. Please use {item} to get the current item value in the expression.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionSelectBase
See also:
choicesVisibleIf
|
||
|
choicesLoaded method | |
Get is question ready to use
Type:
() => void
Implemented in:
Question
|
||
|
choicesOrder property | |
Use this property to render items in a specific order: "asc", "desc", "random". Default value is "none".
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:
none
You may set the following values into this property:
none
, asc
, desc
, random
Implemented in:
QuestionSelectBase
|
||
|
choicesVisibleIf property | |
An expression that returns true or false. It runs against each choices item and if for this item it returns true, then the item is visible otherwise the item becomes invisible. Please use {item} to get the current item value in the expression.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionSelectBase
|
||
|
clearErrors method | |
Call this function to clear all errors in the question
Type:
() => void
Implemented in:
Question
|
||
|
clearIncorrectValues method | |
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
|
||
|
clearIncorrectValuesCallback property | |
If the clearIncorrectValuesCallback is set, it is used to clear incorrrect values instead of default behaviour.
Type:
() => void
readonly
Implemented in:
QuestionSelectBase
|
||
|
colCount property | |
The number of columns for radiogroup and checkbox questions. Items are rendred in one line if the value is 0.
Type:
number
writable
Implemented in:
QuestionCheckboxBase
|
||
|
comment property | |
The question comment value.
Type:
string
writable
Implemented in:
Question
|
||
|
commentText property | |
Use it to get or set the comment value.
Type:
string
writable
Implemented in:
Question
|
||
|
correctAnswer property | |
The correct answer on the question. Set this value if you are doing a quiz.
Type:
any
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
cssClasses property | |
Returns all css classes that used for rendering the question. You may use survey.updateQuestionCssClasses event to override css classes for a question.
Type:
any
readonly
Implemented in:
Question
See also:
SurveyModel.updateQuestionCssClasses
|
||
|
currentErrorCount property | |
Returns the validation errors count.
Type:
number
readonly
Implemented in:
Question
|
||
|
customWidget property | |
The link to the custom widget.
Type:
QuestionCustomWidget
readonly
Implemented in:
Question
|
||
|
defaultValue property | |
Set the default value to the question. It will be assign to the question on loading the survey from JSON or adding a question to the survey or on setting this property of the value is empty.
Type:
any
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
description property | |
Question description. It renders under question 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:
Question
See also:
title
|
||
|
descriptionLocation property | |
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
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
, underInput
, underTitle
Implemented in:
Question
|
||
|
enabledChoices property | |
The list of enabled items as they will be rendered. The disabled items are not included
Type:
ItemValue[]
readonly
Implemented in:
QuestionSelectBase
|
||
|
enableIf property | |
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.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
focus method | |
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
|
||
|
fullTitle property | |
Returns the title after processing the question template.
Type:
string
readonly
Implemented in:
Question
See also:
SurveyModel.questionTitleTemplate
|
||
|
getAllErrors method | |
Returns a copy of question errors survey. For some questions like matrix and panel dynamic it includes the errors of nested questions.
Type:
() => SurveyError[]
Implemented in:
Question
|
||
|
getDisplayValue method | |
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
|
||
|
getLocale method | |
Returns the current survey locale
Type:
() => string
Implemented in:
Question
See also:
SurveyModel.locale
|
||
|
getPlainData method | |
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; calculations?: { propertyName: string; }[]; }) => any
Parameters:
options, type: { includeEmpty?: boolean; calculations?: { propertyName: string; }[]; }
Implemented in:
Question
|
||
|
getTitleLocation method | |
Return the title location based on question titleLocation property and QuestionTitleLocation of it's parents
Type:
() => string
Implemented in:
Question
|
||
|
getType method | |
Returns the type of the object as a string as it represents in the json.
Type:
() => string
Implemented in:
Question
|
||
|
hasComment property | |
Set it to true, to add a comment for the question.
Type:
boolean
writable
Implemented in:
Question
|
||
|
hasErrors method | |
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
|
||
|
hasInput property | |
Returns false if the question doesn't have an input element, for example: QuestionHtmlModel
Type:
boolean
readonly
Implemented in:
Question
|
||
|
hasNone property | |
Set this property to true, to show the "None" item on the bottom. If end-user checks this item, all other items would be unchecked.
Type:
boolean
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionCheckboxModel
|
||
|
hasSelectAll property | |
Set this property to true, to show the "Select All" item on the top. If end-user checks this item, then all items are checked.
Type:
boolean
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionCheckboxModel
|
||
|
hasTitle property | |
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
|
||
|
id property | |
The unique identificator. It is generated automatically.
Type:
string
writable
Implemented in:
Question
|
||
|
indent property | |
Set it different from 0 to increase the left padding.
Type:
number
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
You may set the following values into this property:
0
, 1
, 2
, 3
Implemented in:
Question
|
||
|
isAllowTitleLeft property | |
Returns true if the question may have a title located on the left
Type:
boolean
readonly
Implemented in:
Question
|
||
|
isAllSelected property | |
Returns true if all items are selected
Type:
boolean
writable
Implemented in:
QuestionCheckboxModel
See also:
toggleSelectAll
|
||
|
isEmpty method | |
Returns true if the question value is empty
Type:
() => boolean
Implemented in:
Question
|
||
|
isItemSelected method | |
Returns true if item is checked
Type:
(item: ItemValue) => boolean
Parameters:
item, type: ItemValue , checkbox item value
Implemented in:
QuestionCheckboxModel
|
||
|
isOtherSelected property | |
Returns true if a user select the 'other' item.
Type:
boolean
readonly
Implemented in:
QuestionSelectBase
|
||
|
isPanel property | |
Always returns false.
Type:
boolean
readonly
Implemented in:
Question
|
||
|
isReadOnly property | |
Retuns true if readOnly property is true or survey is in display mode or parent panel/page is readOnly.
Type:
boolean
readonly
Implemented in:
Question
|
||
|
isRequired property | |
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.
Type:
boolean
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
isVisible property | |
Returns true if the question is visible or survey is in design mode right now.
Type:
boolean
readonly
Implemented in:
Question
|
||
|
moveTo method | |
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
|
||
|
no property | |
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
|
||
|
noneItem property | |
Returns the none item. By using this property, you may change programmatically it's value and text.
Type:
ItemValue
readonly
Implemented in:
QuestionCheckboxModel
See also:
hasNone
|
||
|
noneText property | |
Use this property to set the different text for none item.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionCheckboxModel
|
||
|
onReadyChanged event | |
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:
Event<(sender: Question, options: any) => any, any>
Implemented in:
Question
|
||
|
otherErrorText property | |
The text that shows when the other item is choosed by the other input is 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:
QuestionSelectBase
|
||
|
otherItem property | |
Returns the other item. By using this property, you may change programmatically it's value and text.
Type:
ItemValue
readonly
Implemented in:
QuestionSelectBase
See also:
hasOther
|
||
|
otherPlaceHolder property | |
Use this property to set the place holder text for other or comment field .
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionSelectBase
|
||
|
otherText property | |
Use this property to set the different text for other item.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionSelectBase
|
||
|
page property | |
Get/set the page where the question is located.
Type:
IPage
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
parent property | |
A parent element. It can be panel or page.
Type:
IPanel
writable
Implemented in:
Question
|
||
|
processedTitle property | |
Returns the rendred question title.
Type:
string
readonly
Implemented in:
Question
|
||
|
removeError method | |
Remove a particular error from the question error list.
Type:
(error: SurveyError) => void
Parameters:
error, type: SurveyError
Implemented in:
Question
|
||
|
renderWidth property | |
The rendered width of the question.
Type:
string
writable
Implemented in:
Question
|
||
|
requiredErrorText property | |
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
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
requiredIf property | |
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.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
See also:
isRequired
|
||
|
requiredText property | |
Returns the char/string for a required question.
Type:
string
readonly
Implemented in:
Question
See also:
SurveyModel.requiredText
|
||
|
rightIndent property | |
Set it different from 0 to increase the right padding.
Type:
number
writable
Implemented in:
Question
|
||
|
runCondition method | |
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
|
||
|
selectAll method | |
Select all items, except other and none.
Type:
() => void
Implemented in:
QuestionCheckboxModel
|
||
|
selectAllItem property | |
Returns the select all item. By using this property, you may change programmatically it's value and text.
Type:
ItemValue
readonly
Implemented in:
QuestionCheckboxModel
See also:
hasSelectAll
|
||
|
selectAllText property | |
Use this property to set the different text for Select All item.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
QuestionCheckboxModel
|
||
|
startWithNewLine property | |
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
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:
Question
|
||
|
storeOthersAsComment property | |
Please use survey.storeOthersAsComment to change the behavior on the survey level. This property is depricated and invisible in Survey Creator.
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.
Possible values are: "default", true, false
Type:
any
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
, True
, False
Implemented in:
QuestionSelectBase
See also:
SurveyModel.storeOthersAsComment
|
||
|
title property | |
Question title. Use survey questionTitleTemplate property to change the title question is rendered. If it is empty, then question name 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:
Question
See also:
SurveyModel.questionTitleTemplate
|
||
|
titleLocation property | |
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:
Question
See also:
SurveyModel.questionTitleLocation
|
||
|
toggleSelectAll method | |
It will select all items, except other and none. If all items have been already selected then it will clear the value
Type:
() => void
Implemented in:
QuestionCheckboxModel
|
||
|
useDisplayValuesInTitle property | |
Use it to choose how other question values will be rendered in title if referenced in {}.
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:
Question
|
||
|
validators property | |
The list of question validators.
Type:
SurveyValidator[]
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
value property | |
Get/Set the question value.
Type:
any
writable
Implemented in:
Question
|
||
|
valueName property | |
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'.
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
||
|
visible property | |
Use it to get/set the question 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:
Question
See also:
visibleIf
|
||
|
visibleChoices property | |
The list of items as they will be rendered. If needed items are sorted and the other item is added.
Type:
ItemValue[]
readonly
Implemented in:
QuestionSelectBase
|
||
|
visibleIf property | |
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
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
See also:
visible
|
||
|
visibleIndex property | |
Returns the visible index of the question in the survey. It can be from 0 to all visible questions count - 1
Type:
number
readonly
Implemented in:
Question
|
||
|
width property | |
Use it to set the specific width to the question like css style (%, px, em etc).
Type:
string
writable
The property is serializable. It is stored in survey json and you can edit it in the SurveyJS Creator.
Implemented in:
Question
|
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.