Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/remove properties in run-time #135

Closed
andrewtelnov opened this issue Nov 28, 2016 · 5 comments
Closed

Add/remove properties in run-time #135

andrewtelnov opened this issue Nov 28, 2016 · 5 comments

Comments

@andrewtelnov
Copy link
Member

andrewtelnov commented Nov 28, 2016

Two new methods have been added:

JsonObject.metaData.addProperty(className, propertyDescription);
JsonObject.metaData.removeProperty(className, propertyName);

The property will be added into the class: className (string, case sensitive) and all it's descendants.
propertyDescription it can be string or json object.
For example: "mynewProperty" = {name: "mynewProperty"} the default type is string,
"mynewProperty:boolean" = {name: "mynewProperty", type: "boolean"}.
The following types are available:
"string" - default type, "boolean", "numeric", "text" (large text), "html", "itemvalues" (to edit ItemValue array).

{ name: "showProgressBar", default: "off", choices: ["off", "top", "bottom"] }

The following example shows a string property with default value "off" and 3 choices "off", "top" and "bottom". Survey editor will use dropdown input to edit it.

@andrewtelnov
Copy link
Member Author

The demo was added.

@fabien
Copy link

fabien commented Feb 16, 2017

I cannot see the demo code when I follow that link - it appears not to load correctly. The other customization demos won't load for me either.

@andrewtelnov
Copy link
Member Author

@fabien Does this link work for you? http://editor.surveyjs.io/examples/addproperties.html#code
It works fine for me and there is the similar issue, #234, which is closed already.

Thank you,
Andrew

@LA95
Copy link

LA95 commented Dec 5, 2017

What if I want to remove the '*' in a matrixtype questionnaire?

@andrewtelnov
Copy link
Member Author

@LA95 Could you please describe your question in more details?

Thank you,
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants