Giter Club home page Giter Club logo

Comments (8)

andrewtelnov avatar andrewtelnov commented on May 30, 2024 3

Options "Generate Valid JSON" and "Generate Readable JSON" are added.
Updated http://surveyjs.org/builder/ and http://dxsurvey.com
To set them manually use:
var options = {}; options.generateValidJSON = true; var editor = new SurveyEditor.SurveyEditor("editor", options);
to show options menu in the editor set:
editor.showOptions = true;

I believe the issue is solved.

Thank you,
Andrew

from survey-library.

andrewtelnov avatar andrewtelnov commented on May 30, 2024 1

I will add a valid JSON generation as an option.

from survey-library.

andrewtelnov avatar andrewtelnov commented on May 30, 2024

I am using JSON5 to generate the JSON in the Visual Editor - http://json5.org/.
This extension is easier to maintain by humans, IMHO.

You may use the standard/valid JSON - it should work as well.
Do you have any issues with this JSON5?
If yes, please describe. I may add the standard JSON generation optionally.

Thank you,
Andrew

from survey-library.

ahelmberger avatar ahelmberger commented on May 30, 2024

I didn't see this issue. There is a PR in the editor repository dealing with this issue surveyjs/survey-creator#7

The issue with the current output is simply that it is not valid JSON. In JSON it is mandatory to double-quote the keys. See also: http://json.org/

JSON5 is not a subset of JSON, it is a deviation, and thus not compatible with JSON.

from survey-library.

andrewtelnov avatar andrewtelnov commented on May 30, 2024

Added options dropdown button:
http://surveyjs.org/builder/
I will add this functionality to dxsurvey.com later.

from survey-library.

ahelmberger avatar ahelmberger commented on May 30, 2024

Thank you, that saves us a LOT of time :-)

from survey-library.

c0bra avatar c0bra commented on May 30, 2024

@andrewtelnov this should really go in the docs or a FAQ or something. Got lucky searching through the issues but I would have been really frustrated and worried as I was initially going to eval() the text output into an object which is very insecure.

from survey-library.

andrewtelnov avatar andrewtelnov commented on May 30, 2024

@c0bra You are right. We need documentation.
Unfortunately, we are not able to produce a quality docs right now. We will work on them later.
What we can do and actually had to some times ago, create an example and describe all available options. I have added this task to our TODO list.

Thank you,
Andrew

from survey-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.