how to bind survey.data.x array with choices ?
bind a survey.data.x with radio button choices
Answers
Thanks Serge i found out the solution but can we make it dynamic like "choices": "{employers.name}" here the panel is the dynamic panel which bind the data with employers.name array ?
???
According to the documentation https://surveyjs.io/Documentation/Library/?id=surveymodel#data
the survey.data property is
An object that stores the survey results/data. You may set it directly as { 'question name': questionValue, … }
you can just write
JavaScriptsurvey.data.x = [ "item1", "item2" ]
in case of "x" is a name of checkbox question
You are talking about a radiogroup question. Radiogroup question can store only one choosen item:
JavaScriptsurvey.data.x = "item1";
If you want to set an array of possible options for a radiogroup question (probably the https://surveyjs.answerdesk.io/ticket/details/t682 question), you should use the choices
property (https://surveyjs.io/Documentation/Library/?id=questionradiogroupmodel#choices)) of a question, as illustrated in this sample - https://plnkr.co/edit/DpqFyFynZaOQEQLtFmA0?p=preview
Thanks, Serge
SurveyJS Team
please some?