Hi team,
I want to add like this as an option in question type and these both options will have existing template names in drop-down which are component in other files whenever it will be clicked by user that component will be called so how can I do that, I have attached an image below.
Thanks!
Component
created a year ago
(modified a year ago)
Show previous comments
(0)
Comments
(0)
Sign in to comment on this post
Answers approved by surveyjs Support
Hello,
Please follow these steps to achieve your goal.
- Use the
creator.onDefineElementMenuItems
event to register custom adorner actions. To initialize a drop-down action and populate its item list, use thecreateDropdownActionModel
function from the"survey-core"
module. For more details, please visit Create Custom Adorners. - Once a user selects a new template, you can modify a question definition and apply some new configuration. For this, use the question.fromJSON function and pass a JSON object which defines a new question configuration.
I hope this information helps. Please let me know if you have further questions.