Question T15021
Visible to All Users

Raise onGetQuestionTitleActions after rendering the first load of Survey Form

created a year ago

onGetQuestionTitleActions event is raising only for the first load of Survey. I want to raise this event again as the current requirement is to raise this event again on updating some question titles based on the specific text of the title.

JavaScript
const onGetQuestionTitleActions = (_, opt) => { if (opt.question?.title?.indexOf(matchingText) >= 0) { opt.titleActions = [ { title: 'More Info', innerCss: 'btn-more-info-class', action: () => { showDescription(opt.question); } } ]; } };

Answers approved by surveyjs Support

created a year ago

Hello,
You need to create the survey model without JSON parameter, set all handlers and then load the survey from JSON.

JavaScript
const survey = new Model(); //Set event handlers survey.fromJSON(json);

Thank you,
Andrew
SurveyJS Team

    Comments (3)
    AT AT
    Andrew Telnov a year ago

      In fact, it will be enough to add the handler before rendering.

      Thank you,
      Andrew
      SurveyJS Team

      A A
      Ajuria - Forms Creation a year ago

        Thank you Andrew. It worked. Thank you

        AT AT
        Andrew Telnov a year ago

          You are very welcome!

          Andrew
          SurveyJS Team