survey-library
survey-library copied to clipboard
Other option in matrix dropdown
Are you requesting a feature, reporting a bug or asking a question?
Bug
What is the current behavior?
When configuring a column in a matrixdropdown question to have an other option the text box is not shown when using the "show in multiple columns" option.
What is the expected behavior?
It should either work, or not be available as an option in the survey builder.
How would you reproduce the current behavior (if this is a bug)?
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://surveyjs.io/create-survey
Test code
{
"logoPosition": "right",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "matrixdropdown",
"name": "V001",
"title": "Testvraag",
"columns": [
{
"name": "1",
"title": " ",
"cellType": "checkbox",
"showInMultipleColumns": true,
"choices": [
{
"value": "1",
"text": "Antwoord A"
},
{
"value": "2",
"text": "Antwoord B"
},
{
"value": "3",
"text": "Antwoord C"
}
],
"hasOther": true,
"noneText": "Geen van bovenstaande",
"otherText": "Anders, namelijk:"
}
],
"choices": [
1,
2,
3,
4,
5
],
"rows": [
{
"value": "1",
"text": "Aspect A"
},
{
"value": "2",
"text": "Aspect B"
}
]
}
]
}
],
"questionsOnPageMode": "questionPerPage"
}
Specify your
- browser: https://whatismybrowser.com/w/4XXXETH
- surveyjs platform (angular or react or jquery or knockout or vue): knockout
- surveyjs version: 1.9.44
@SamMousa Do you want to see comment in this column?
Thank you, Andrew
Yeah, if there is an other option it makes sense to show it.
I think we could do it based on the showInMultipleColumns
option.
If showInMultipleOptions
and hasOther
is enabled, create an extra column that is empty (and collapsed to 0 width).
When a row is has the other
option checked show the comment field in that row and expand the column.
If showInMultipleOptions
is disabled it already works.
@SamMousa We will rebuild the table layout on changing "hasOther" as we do if choices are changed.
Thank you, Andrew