Search filters on a non-database filled Template Grid

0
I would like to fill a Template Grid based on either a Microflow or Association. However, this does not allow me to put search filters in the grid. Can anyone tell me why this is and how I can work around this? Some context: I try to create statusfiterbuttons above the Template Grid. This will allow the user to see how many objects are in the database with a certain status and click on that status to only see those objects. Next to these buttons, I also want regular search filters including the name of the object, etc.
asked
2 answers
1

When you search in Mendix, the system discards the original contents of the data grid and performs an entirely new database query. When you fill a data grid by microflow, the system has no way of determining what that new query should look like as it doesn't know how you got the objects in the first place. Hence, the search function is disallowed for grids filled by microflow.

Your statusfilter problem can be solved easily enough by nesting your grid in a data view with a selection object and a Status dropdown. With an on-change microflow you can then do your own search by means of a retrieve and populate the association over which you fill the grid with the results. Though it may seem a bit roundabout, that should also work for most of your search needs. You could even use a single text box to search over multiple attributes if you don't mind adding a little complexity to the on-change flows.

answered
0

Not ideal, but an alternative would be to populate an Entity with the data needed in your Microflow, build the Template Grid based on that Entity and then you have the search filters available. Associate that entity to the user so that at the start of the Microflow you retrieve and delete results from a previous navigation to the page and rebuild it. I've used this work around in the past and it does get the UX you are looking for while adding a bit over I/O overhead to the db.

answered