Skip to content

Commit

Permalink
Describe value types for different question types (#6756)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanTsukanov committed Aug 18, 2023
1 parent 7bc48b3 commit e842725
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1286,8 +1286,32 @@ export class Question extends SurveyElement<Question>
public get isValueArray(): boolean { return false; }
/**
* Gets or sets the question value.
* @see SurveyModel.setValue
* @see SurveyModel.getValue
*
* The following table illustrates how the value type depends on the question type:
*
* | Question type | Value type(s) |
* | ------------- | ------------- |
* | Checkboxes | `Array<String \| Number>` |
* | Dropdown | `String` \| `Number` |
* | Dynamic Matrix | `Array<Object>` |
* | Dynamic Panel | `Array<Object>` |
* | Expression | `String` \| `Number` \| `Boolean` |
* | File Upload | `File` \| `Array<File>` |
* | HTML | (no value) |
* | Image | (no value) |
* | Image Picker | `Array<String \| Number>` |
* | Long Text | `String` |
* | Multi-Select Dropdown | `Object` |
* | Multi-Select Matrix | `Object` |
* | Multiple Textboxes | `Array<String>` |
* | Panel | (no value) |
* | Radio Button Group | `String` \| `Number` |
* | Ranking | `Array<String \| Number>` |
* | Rating Scale | `Number` \| `String` |
* | Signature | `String` (base64-encoded image) |
* | Single-Line Input | `String` \| `Number` \| `Date` |
* | Single-Select Matrix | `Object` |
* | Yes/No (Boolean) | `Boolean` \| `String` |
*/
public get value(): any {
return this.getValueCore();
Expand Down

0 comments on commit e842725

Please sign in to comment.