Reference Selector widget currently does not support assigning dynamic CSS classes to individual options based on their attributes.
A recommended workaround is to replace the Reference Selector with a custom selection pattern using a ListView or DataGrid2. You can open a popup page, display the selectable objects in a ListView or DataGrid2, and use the Dynamic class property on the container or row to assign a CSS class based on the object’s attribute.
This approach provides full control over styling and is the most flexible and maintainable solution for implementing attribute-based visual differences between selectable items.
hi,
No in standard Mendix Reference Selector, you cannot apply dynamic styling per option.
The dropdown options are rendered internally and Mendix does not expose a property to assign classes conditionally to each item.
Reference Selector:
Use a Custom Selector Page:
Based on attribute
This gives full styling control.
Use Combo Box (Data Widgets module)
But even here, dynamic styling per option is limited and not fully supported.
Dropdown options are rendered dynamically and not easily styleable.
If you need dynamic styling per option, do not use Reference Selector.
Use a custom selection page with List View/DataGrid and conditional classes.
That is the clean and scalable solution.