Data grid 2: Overwriting Default value of Data Grid Text Filter with empty value does not work

Hi, For a project, we want to build a custom search with the data grid 2. We have found a very elegant work around the search and that is by populating the ‘Default value’ in the Data Grid Text Filter with the search query and refreshing the object on change. This works quite well, except for the following situation. After a search query has been entered and we want to reset the search, the Data Grid Text Filter does not take the value empty or ‘’. For instance, if we searched ‘man’ and deleted the search query in the custom search bar, the Data Grid Text Filter stays on ‘m’. Can anyone explain me: Why the Data Grid Text Filter does not allow empty values to be set on the ‘Default value’ How we can fix this?   If we get this working, this would mean a major improvement for all custom search in Mendix. Thanks in advance!
1 answers

Hi Olaf,

Some things that could help:

  1. Did you update the data widget? The issue you’ve reported seems to have affected older versions of the widget 
  2. I tried the same things you’ve mentioned but even with the updated version of the widget the text filter widget did not really clear out on press of the reset button (though it did clear when you manually clear the text filter widget). So this may be a bug which you could report to Mendix
  3. I did manage to get this to work partially although the solution is not pretty – When you want to reset all the filters you can call a javascript action to reload the entire page using mx.reloadWithState().
  4. Additionally, I used the text filter widget inside the filter column to let Mendix provide the capability of clearing out those values. If you want to have dropdown associated with another entity then sadly it does not clear out but it allows filtering the values. I continued using the default value feature and hid them on screen.
  5. NOTE: Clearing out individual dropdown widgets used for filtering does not seem to work due to issue described in 2.


Hope this helps a bit! Good luck