Open notz opened 4 years ago
Everything seems working if it's done after onAfterRenderSurvey event.
@notz You can assign the data at any time and it should work, unless you do not clear the survey.data. If you create a simple example in plunker that shows the issue then we can take a look to fix the issue for others. The simplest way to create the plunker example is to go to our examples, select "Edit in..." dropdown on the right top corner of the page and select plunker. After that in js file change the JSON and code.
Thank you, Andrew
I only copied your get/set result sample to your survey creator and loaded your sample from there. It's not working anymore: https://plnkr.co/edit/Np1DqV5NTANxD0mi
@notz Got it. Survey overrides data when the survey JSON comes from our service and it happens after survey.data
is set. The request to our service, as to any service, is async.
You need to use survey.onLoadedSurveyFromService event. Here is the working example.
Thank you, Andrew
Are you requesting a feature, reporting a bug or asking a question?
Bug
What is the current behavior?
Starting a survey loaded from survey creator with pre-filled data, the checkbox items should also be set/unset according the pre-filled data. Currently it's only working for textboxes or boolean. Seems that default values get overridden by pre-filled data.
survey.data = {feel: ["desparate"]}
What is the expected behavior?
If started with pre-filled data the data should be preferred to the default choice.
How would you reproduce the current behavior (if this is a bug)?
Create an survey with a checkbox and load it with data set.
Specify your