How to use drop down filter in list view on enum values

0
I want to filter out list view rows based on an enumeration value using drop down filter. I was unable to bind the attribute to drop down filter and unable to fetch enumeration values into drop down filter.
asked
3 answers
4

Hi, 

Consider, I have an entity with two attributes one is String datatype and other one enumerated datatype as shown below

I have a listview where I can view employees as shown below 

 We can configure the dropdown filter for enumerated attributes like below 

answered
0

Hi Prasanthi,

you could use a data view with a new entity “FilterItem” that just holds the enumeration as an attribute. Use context as data source and make sure the enum attribute has a default value.

Place a drop down inside and choose the enum as attribute.

Place your list inside the data view. Use a new microflow as data source. In this microflow you use the entity from the data view and retrieve all “ListViewItem”s that have the corresponding value.

To apply changes that are made to the filter, add an on-change-event to the drop down. Change on-change to show a page and pass the “FilterItem” as parameter (that will be done automatically).

Domain model:

Page:

Microflow:

Best regards

Linus

answered
0

I had a quick crack at getting a drop-down filter working on list views and also could not quite get it.  Have you tried using the new Data grid 2 widget?  It looks like it is possible to achieve what you need with it here:

https://docs.mendix.com/appstore/modules/data-grid-2#7-2-drop-down-filter

 

answered