Angular SelectBox - Customize Item Appearance
To customize the appearance of items in the SelectBox drop-down menu, configure itemTemplate (customizes all items) or items[].template (customizes individual items).
app.component.html
- <dx-select-box ...
- itemTemplate="item"
- >
- <div *dxTemplate="let data of 'item'">
- <img src="{{ data.imgSrc }}" />
- </div>
- </dx-select-box>
You can also customize the SelectBox input field. Configure fieldAddons.beforeTemplate and fieldAddons.afterTemplate to display custom markup to the left/right of the component input:
app.component.html
- <dx-select-box ... >
- <dxo-select-box-field-addons
- beforeTemplate="before"
- ></dxo-select-box-field-addons>
- <div *dxTemplate="let data of 'before'">
- <img src="{{ data.imgSrc }}" />
- </div>
- </dx-select-box>