Question T7533
Visible to All Users

How I can do custom widget editable?

created 4 years ago (modified 4 years ago)

[Ticket cloned from T7531: About Licence]

Hello Andrew thank for your quick response.

Andrew Can you guide me to, How I can do custom widget editable?, i.e for example

A widget Yes/No,
How Can I active option for edit title and options. Is possible?

I hope your answers.

Nelson

Answers approved by surveyjs Support

created 4 years ago

Hello,

All properties of a custom widget added via "Survey.Serializer.addProperty" function become editable in the properties pane. This shown in this live sample on our site - https://surveyjs.io/Examples/Survey-Creator?id=addproperties&theme=bootstrap

If you want to create inplace editors, then you need to implement such editors yourself in the "onAfterRenderQuestion" event handler for survey on design surface.

Thanks, Serge
SurveyJS Team

    Other Answers

    created 4 years ago

    Hello Serge, thanks for your quick response.

    **If you want to create inplace editors, then you need to implement such editors yourself in the "onAfterRenderQuestion" event handler for survey on design surface.
    **

    Serge, Do you can give me a example, please I need?

    I hope your answer.
    Nelson

      Comments (3)

        Hello,

        Since a custom widget markup is very generic I can't share you a sample that will work for all cases.
        You can check the source code of adorners in survey-creator V1 - https://github.com/surveyjs/survey-creator/blob/master/packages/survey-creator/src/adorners/title-editor.ts
        This adorner is responsible for inplace text editing. As you can see, the code is rather complex.
        And this is the case for editable strings.
        In Survey Creator V2 all localizable strings rendered the proper way will be editable on design surface.

        For other inplace editors (e.g. add item or choose an image) you need to implement completely different code.

        Thanks, Serge
        SurveyJS Team

          Hello Serge thank for your quick response.

          Serge in This answer you talk about survey creator.

          I have a question.

          I have a buy licence as developer for working with editor control?

          I hope your answer.

          Regards,
          Nelson

            Hello,

            I have a buy license as developer for working with editor control?

            you need to purchase commercial license(s) for software developer(s) who want to integrate our products into your applications.

            You can also check this page for more details - https://surveyjs.io/Licenses

            Thanks, Serge
            SurveyJS Team