Codevar localStorageName = "SaveLoadSurveyCreatorExample";
const options = {
showDesignerTab: true,
showTestSurveyTab: true,
showLogicTab: true,
showTranslationTab: true,
showJSONEditorTab: true,
showThemeTab: true,
alwaySaveTextInPropertyEditorsValue:true,
isAutoSave: true,
// Show state button here
showState: true,
saveSurveyFunc: function (saveNo, callback) {
window.localStorage.setItem(localStorageName, creator.text);
//We assume that we can't get error on saving data in local storage
//Tells creator that changing (saveNo) saved successfully.
//Creator will update the status from Saving to saved
callback(saveNo, true);
},
};
function renderCreator(options) {
const json = !!creator ? creator.JSON : {};
creator = new SurveyCreator.SurveyCreator(options);
creator.JSON = json;
creator.showSidebar = false;
creator.toolbox.forceCompact = false;
creator.render("surveyElement");
}
renderCreator(options);
JSON Editor is empty
logic also empty