Drop-Down Menu with Custom Item Template
If you want to customize a drop-down menu item, follow the steps below:
Implement a component that renders item markup.
The item is an object that implements theIAction
interface. This object is passed to the component as a prop.Register the component so that it can be accessed by name.
In React, register the component inReactElementFactory
as shown in theSurveyComponent.jsx
file.
In Angular, register the component inAngularComponentFactory
as shown in thesurvey.component.ts
file.
In Vue and Knockout, use techniques native to these libraries:Assign the component name to the Dropdown question's
itemComponent
property in the survey JSON schema.