How to save ENUM values in Saved attribute in dropdown filter for datagrid2?

0
In our app we have a datagrid 2 which is used for an excel export. We have several filters on the data, one string filter, one data filter and two dropdown filters for enums.    We only want to export the filtered data, but the enum filters are not being saved. I would expect a string value of the ENUM in the saved attribute.    The string and date filters don't give any issues.    Any advice for this?   These are my settings:  
asked
3 answers
0

Hi Fien,

make your own custom filter where you can save the enum values in string variable/attribute then you can export your filters data.

 

Try this

https://medium.com/mendix/create-your-own-way-of-filter-by-npe-non-persistant-entity-and-microflow-4ffd11e52fb0

 

Hope you like the answer.

 

answered
0

Hi Fien, 

 

In the on change event, ensure that you commit (and possibly refresh) the entity on which your attribute exists to store the last value. The datagrid will set the attribute, but not store it in the database. When debugging this on change microflow, you should be able to see the updated string value be committed.

 

If you want to show the stored filter configuration upon loading your page, be sure to set the filter's default value to '_BloodTypeFilterSavedAttribute'.

 

Best,

Walter

answered
0

1] Create a non persistent entity with all same fields as in Data Grid.

2] Associate it to main entity .[1-*]

3] Now This will be your custom filter entity : make sure you maintain single obj in logic.

4] Now on change activity in all filter field call microflow, Retrieve main entity value add x path and compare it with all respective value user added in filter entity i.e. non persistent entity.

5]At the end add the above retrieved list in association with non-persistent entity.

6]Set data source of Data grid to microflow and create  new  microflow.

7] Retrieve the main entity from association with non persistent entity.

- As on change of each filed in filter list gets updated every time in association which is eventually a data source for data grid.

answered