Question T12766
Visible to All Users

Any example I can access custom widgets answers

created 2 years ago

My project use React. I have created a custom table question extends from SurveyQuestionElementBase, by using registerQuestion I can render the question in the survey. But I'm not very sure about what is the best practice to access custom widgets answer.
Thanks!

Comments (1)

    Hello Wenjing,
    You can declare a value property for your custom question and return the required value taken from your custom table. For instance, take a look at the following demo: Add a Custom Question Type. In this sample, we implement a custom question based on a React Color component. The SurveyQuestionColorPicker class extends the SurveyQuestionElementBase and implements the value property. This property returns the value of a base question object:

    Code
    get value() { return this.question.value; }

    You can implement this property and return a necessary value.

    Please let me know if this helps.