Question T17155
Visible to All Users

Property `obj` is not existing in the interface PropertyEditorCreatedEvent but is still sent in the actual javascript object

created a year ago (modified a year ago)

I noticed after the release v1.9.128, that interface changes happened. I wanted to draw your attention that PropertyEditorCreatedEvent is missing obj while it is received in the actual js object.
Clipboard-File-2.png
Clipboard-File-1.png

Answers approved by surveyjs Support

created a year ago

Hello,
I have updated our event by adding "obj" property into it. It will be available in the version we will release next week.
Meanwhile, please case to any (<any>options).obj.isQuestion,

Thank you,
Andrew
SurveyJS Team

    Show previous comments (1)

      Hello,
      editor.obj is for internal use. There is a possibility that we change it in the future. It is better to use options.obj.

      Thank you,
      Andrew
      SurveyJS Team

        Hi Andrew,
        i checked the last update, and the issue with options.obj is fixed. However, now the property obj of type Base, does not include the property isQuestion.
        Clipboard-File-1.png

          Hello,
          Thank you for the update. You can cast options.obj to a base SurveyElement class as follows to access the isQuestion property:

          JavaScript
          import { SurveyElement } from "survey-core"; creator.onPropertyEditorCreated.add((sender, options) => { if ((options.obj as SurveyElement).isQuestion) { //... } });

          Please let me know if you have any further questions.

          Other Answers

          created a year ago (modified a year ago)

          I see for example that this obj property is accessible through

          Code
          let event: PropertyEditorCreatedEvent; event.editor.obj;