Question T785
Visible to All Users

Defining Custom Rating Question with custom rating items.

created 7 years ago

Hello,
I'd like to know if we can define the rating items somehow outside the editor, but inside the code.
When creating a custom question like this:

JavaScript
editor .toolbox .addItem({ name: "qolSkala", isCopied: true, iconName: "icon-default", title: "QoL Skala", category: "Quality of Life", json: { "type": "rating", "choices": ["Not at all","A little", "Somewhat","Very"] } });

Thanks for any insights.

Comments (1)

    Hello,

    You can customize just added element in the onQuestionAdded event handler.

    Here is the working sample - set choices for a radiogroup question:
    http://plnkr.co/edit/vnzENS?p=preview

    Thanks, Serge
    SurveyJS Team

    Answers

    created 7 years ago

    Ah okay that was what I was searching for. Thanks alot.

      created 7 years ago

      Okay Thanks. With the Radiogroup question yes. What about the Rating Question? Or alternatively can I reskin the Radiogroup to look like the Rating Question?

      Thanks

        Comments (1)

          Hello,

          You can do the same with the rateValues property.
          See the same plunk - http://plnkr.co/edit/vnzENS?p=preview

          Thanks, Serge
          SurveyJS Team