Question T2095
Visible to All Users

How to use datepicker widget as a question

created 6 years ago

[Ticket cloned from T2057: Create the questions in popup model inside the survey page]

Hi Andrew,

Thanks for your reply. If I want to create the custom surveyjs component (In fact that It is a datepicker was display in a popup). How can I inject this component into another component and use it as a question type?

Thanks you,
Tuan Nguyen

Answers approved by surveyjs Support

created 6 years ago

Hello,
Please review the following example.

Thank you,
Andrew
SurveyJS Team

    Other Answers

    created 6 years ago (modified 6 years ago)

    Hi Andrew,

    Do you have any documentation how to create new custom widget? I want to create a widget as tree view and can search on this tree as well as pick up the selection, the data of tree view will be load from API. The UI similar that:

    Clipboard-File-1.png

    Could you please to check it?

    Thanks,
    Tuan Nguyen

      Comments (3)

        Hello,

        You can check this repo https://github.com/surveyjs/widgets
        And this documented live sample - https://plnkr.co/edit/HdnYE5?p=preview

        Thanks, Serge
        SurveyJS Team

          Hi Serge,

          I 'm wondering how can I load the library ( I meant that the bootstrap-tree view javascript link, some css link) into the property 'htmlTemplate'. I tried to add it but It wasn't affect.

          Thanks,
          Tuan Nguyen

            Hello,

            You needn't to load library into the template. You need to load 3rd party library on your web page as a script and CSS files. In the 'htmlTemplate' property you can add initial markup needed to certain 3rd party library for the widget initialization. You can check this link - https://plnkr.co/edit/HdnYE5?p=preview for more details.

            Thanks, Serge
            SurveyJS Team