Survey-library: Survey js with customised attribute

Created on 9 Feb 2018  路  4Comments  路  Source: surveyjs/survey-library

Are you requesting a feature, reporting a bug or ask a question?

Ask a question

What is the current behavior?

At moment, in survey model, i am only able to retrieve variable on model defined by your library, is there any chance that I could get add custmized variable into question, please?

What is the expected behavior?

In provide plunker, line 50, may I able to get question question.editable value which defined in line 18, please?

Provide the test code and the tested page URL (if applicable)

Tested page URL:
http://plnkr.co/edit/YuUKTzxPBWHIVE5SzVC1?p=preview

question

Most helpful comment

@xiuzhen1103 I am not sure I got you. Do you want to add a property into SurveyJS objects?

Here is the example of adding a tag property into all questions:
Survey.JsonObject.metaData.addProperty("questionbase", { name: "tag:number", default: 0 });

To get more info, go to this page https://surveyjs.io/Examples/Builder/?id=addproperties and then tab: Documentation.

Thank you,
Andrew

All 4 comments

@xiuzhen1103 I am not sure I got you. Do you want to add a property into SurveyJS objects?

Here is the example of adding a tag property into all questions:
Survey.JsonObject.metaData.addProperty("questionbase", { name: "tag:number", default: 0 });

To get more info, go to this page https://surveyjs.io/Examples/Builder/?id=addproperties and then tab: Documentation.

Thank you,
Andrew

hi, is there any chance that if I could use * to point that all the property add triggerAlert
JsonObject.metaData.addProperty("*", { name: "triggerAlert", default: false, choices: [true, false] });

please see @andrewtelnov 's answer below

@xiuzhen1103 @dmitrykurmanov To add property into Panel and Pages, it should be "panelbase"
JsonObject.metaData.addProperty("panelbase", { name: "triggerAlert", default: false, choices: [true, false] });
Thank you,
Andrew

Was this page helpful?
0 / 5 - 0 ratings

Related issues

misamura picture misamura  路  4Comments

aslanbeily picture aslanbeily  路  4Comments

ian-emsens-sb picture ian-emsens-sb  路  3Comments

dmitrykurmanov picture dmitrykurmanov  路  3Comments

dmitrykurmanov picture dmitrykurmanov  路  3Comments