surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
911 stars 373 forks source link

Adding a Custom adorner to Editor #389

Closed rabberbock closed 5 years ago

rabberbock commented 6 years ago

Are you requesting a feature, reporting a bug or ask a question?

Asking a question

I am using surveyjs in React and was wondering if it is possible to add custom adorners to the Survey Editor without modifying the source code?

For example is it possible to add a custom adorner to the question_actions that would add a question before or after the current element, and have a modal popup to choose the question type.

Thanks,

Raffi

andrewtelnov commented 6 years ago

@rabberbock You are may unregister the existing adorners and register a new one. However, SurveyJS Editor is written on knockout. You would have to use the same approach that we have for current adorners. Here is the code. Feel free ask questions here about implementation. We will try to help. You may do the PR, we will likely remove your adorner registration, so it is not applied by default, but code can be in our repo and it can be applied with one line of code. We do not have a lot of docs about adorners, but here is what we have.

Thank you, Andrew