Is it possible to filter on Enum property? #25
-
I am using Enumerations for various properties, stored in the database as int fields. I have configured a ValueMapper for Enum as follows, which works nicely on Create etc. which takes it's value from a configured Umbraco Dropdown DataType. I am wondering if the scenario where I want to be able to add this as a FilterableProperty, using the dropdown DataType in Umbraco should be possible currently, or perhaps could be considered if not for Enum values. It looks like it is using the string value rather than the integer value when running the DB query, and no records are returned as a result. Have I missed something or is this taking the concept a bit far?
Example configuration as follows:
and with property Editor config as:
where the column model is defined as
and the enumeration is
Configured as Dropdown DataType: This displays in the "filter" of the collection as: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think this may be because you are explicitly defining your options. Konstrukt can already automatically handle Enum property and convert the values into a dropdown (even handling |
Beta Was this translation helpful? Give feedback.
I think this may be because you are explicitly defining your options. Konstrukt can already automatically handle Enum property and convert the values into a dropdown (even handling
DescriptionAttributes
for friendly names) so you could try just not defining the options config and see if that works?