Closed JaneSjs closed 9 months ago
To implement a single entry point for saving a survey and theme whenever a survey or theme receives modifications, implement a single saving function and call it from saveSurveyFunc
and saveThemeFunc
.
function saveSurveyAndTheme(){
const surveyJson = creator.JSON;
const themeJson = creator.theme;
//.. Save
alert("Everything is Saved!");
}
creator.saveThemeFunc = () => {
saveSurveyAndTheme();
}
creator.saveSurveyFunc = () => {
saveSurveyAndTheme();
}
T15531 - How to merge save theme and save survey buttons to one button? (save event and modified state) https://surveyjs.answerdesk.io/internal/ticket/details/T15531
Currently, when the creator.syncSaveButtons option is enabled, the Save button invokes the
saveThemeFunc
orsaveSurveyFunc
depending on whether a user modified a survey or theme JSON definition (View Demo).However, the Save button should have a single entry point from which a developer could save both theme and survey JSON definitions to avoid additional POST requests to save those definitions separately.
When the creator.syncSaveButtons option is enabled, the Save button should activate the
saveSurveyFunc
/saveThemeFunc
functions regardless of whether changes were made to a survey or theme JSON definitions.