Question T3490
Visible to All Users

Add a new property i.e, Tag:Number in survey creator

created 5 years ago (modified 5 years ago)

Hi,
I want to add tag property in my survey creator.
I have referred to this Link:
https://surveyjs.io/Examples/Survey-Creator/?id=addproperties#content-js
I am using addProperty method, but they have no effect.
`
import * as SurveyCreator from 'survey-creator';
import * as Survey from 'survey-angular';

export default class SurveyCreator extends Component {

Survey.Serializer.addProperty("question", {name: "tag:number",default: 0,category: "general"});

var editorOptions = {

};
this.editor = new SurveyCreator("surveyCreatorContainer", editorOptions);

render() {
return <div id="surveyCreatorContainer" />;
}
}`

Expected behavior:
tag property gets added to the question property grid.

Actual behavior:
tag property doesn't get added.

Thanks.

Answers approved by surveyjs Support

created 5 years ago

Hello,

Since SurveyJS Creator is using survey-knockout, you need to add the following code:

JavaScript
import * as SurveyKo from 'survey-knockout'; SurveyKo.Serializer.addProperty("question", {name: "tag:number",default: 0,category: "general"});

Thanks, Serge
SurveyJS Team

    Comments (2)
    DB DB
    Deepika Bansal 5 years ago

      I have tried using survey-knockout also.

      PFA: surveyknokout.png

        Hello,

        It works ok for me in this repo - https://github.com/surveyjs/surveyjs_react_quickstart/blob/master/src/SurveyCreator.js

        Probably you are using the old version of the survey-knockout library

        Thanks, Serge
        SurveyJS Team