Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › General Discussions › DropDownList › Coloring list items › Reply To: Coloring list items
October 25, 2022 at 6:27 am
#103914
Participant
Hi,
You can do the following:
- Set a dataSource with the items and in the object, you can add a property for the class
- ForEach the dataSource and for each item, you can get the relevant element and apply the element’s class
Please look at the demo here: https://codepen.io/svetoslavb04/pen/OJEJXbe
Hope this helps!
Best Regards,
Svetoslav Borislavov
Smart UI Team
https://www.htmlelements.com/