surveyjs / surveyjs_react_quickstart

SurveyJS + React Quickstart Template
http://surveyjs.io
140 stars 78 forks source link

Edit The Form #22

Open tabeshR opened 4 years ago

tabeshR commented 4 years ago

Hi I want to edit the form after I created it I Should Pass It To Form Creator And Then Edit It, How Can I Do That ?

tsv2013 commented 4 years ago

You can get designed survey JSON from the SurveyJS Creator via the "creator.JSON" property and create a new survey model with this JSON

tsv2013 commented 4 years ago

All code can be found in this repo

// You can get designed survey JSON from the SurveyJS Creator via the "creator.JSON" property
var surveyJSON = creator.JSON;
....
    // create a new survey model with this JSON
    var survey = new Survey.Model(surveyJSON);
    return (
        <Survey.Survey model={survey} />
    );

https://github.com/surveyjs/surveyjs_react_quickstart/blob/master/src/Survey.js#L55-L64