Question T10062
Visible to All Users

SurveyModel events not fired on Simulator tab

created 2 years ago

Hello,

We would like to use SurveyModel events and to make them apply in the Simulator tab on the Survey Creator, events like "onAfterRenderQuestionInput". Is there a way for a Survey Model to call events in the Simulator tab of the Creator ?

Thank you.

Answers approved by surveyjs Support

created 2 years ago

Hello,

In order to access survey model used in "Preview" tab you need to subscribe the https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#onSurveyInstanceCreated event.

JavaScript
creator.onSurveyInstanceCreated.add(function(sender, options) { if(options.reason == "test") { var testTabSurvey = options.survey; // subscribe testTabSurvey events here } });

Thanks, Serge
SurveyJS Team

    Other Answers

    created 2 years ago

    Indeed, we were working on the SurveyModel inside the creator.

    Thank you for the answer.

      Comments (1)

        Hello,
        In this case please use the approach provided by Serge. You can review the following example.

        Thank you,
        Andrew
        SurveyJS Team
        If you like our products, please take a moment to share your experience with our company by contributing a short review for SurveyJS page at g2.com or at Trustpilot.com.
        As we’re building our business, every review helps build credibility for future customers and your feedback would be greatly appreciated.