Changing choices of a checkbox/ radio question programmatically by surveyModel should chnage choices of all the question with selected name, not the first occurence only
See original GitHub issueJSON = {
"pages": [
{
"name": "page1",
"elements": [
{
"type": "dropdown",
"name": "sourceModel",
"title": "Source Model",
"isRequired": true,
"choices": [
"m1",
"m2"
]
},
{
"type": "dropdown",
"name": "type",
"title": "Type of chart",
"isRequired": true,
"choices": [
{
"value": "big_number_1",
"text": "Big Number"
},
{
"value": "pie",
"text": "Pie Chart"
}
]
},
{
"type": "panel",
"name": "bign1Panel",
"elements": [
{
"type": "text",
"name": "title",
"title": "Title",
"isRequired": true
},
{
"type": "radiogroup",
"name": "column",
"title": "Field containing the number (make sure the source has only one row after aggregation)",
"choices": [
"item1",
"item2",
"item3"
]
}
],
"visibleIf": "{type} = \"big_number_1\"",
"title": "Big Number Configuration"
},
{
"type": "panel",
"name": "piePanel",
"elements": [
{
"type": "radiogroup",
"name": "column",
"title": "Column to rotate",
"choices": [
"item1",
"item2",
"item3"
]
}
],
"visibleIf": "{type} = \"pie\"",
"title": "Pie Chart Configuration"
}
],
"navigationButtonsVisibility": "hide"
}
]
}
// In JS:
// we have 2 different questions with same name but different titles in different panels,
// on changing 2nd question we execute following line
surveyModel.getQuestionByName("column").choices = ["s1","s2","s3"];
// above line does change the choices of the first title with name column but 2nd title with name column does not get the new choices.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Check box variable - Ability to select multiple ch... - ServiceNow
We would like to have check box instead of radio button so that users can be able to select multiple choices. Any help...
Read more >Single Column Question – SurveyMonkey Apply
The Single Column Question type allows you to create a question with a ... text response for name, or a checkbox/radio button for...
Read more >REDCap Frequently Asked Questions - Wiki@UCSF
If you want to send surveys to participants and pipe in values (ex: first and last name); create a data entry instrument prior...
Read more >Checkbox | Semantic UI
A checkbox allows a user to select a value from a small set of options, often binary.
Read more >Angular mat-selection-list, How to make single checkbox ...
You have to set SelectionModel for selectedOptions property of component reference on init. @ViewChild(MatSelectionList, {static: true}) private ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@omkardusane This functionality has been implemented.
Thank you, Andrew
Thanks Surveyjs Team