Datagrid 2 - Refresh issue - Filtervalue stays active after hiding a colomn

0
Dear Mendix community,    We are using datagrid 2 with about 29 colomns and 29 saveable filters. Each user has it's own saveable configuration and is able to switch between them. We've build a refresh button to empty the filters value's but the only way to force the datagrid 2 to refresh is by reshowing page. This on itself is a minor issue.   The bigger and simlilar problem goes as follows:  The moment a user chooses to hide a colomn (and accompanying filter), the filtervalue stays applied. We've build a machanism to empty the filtervalue by importing the personal configuration JSON string. from JSON attribute "hidden" we are able to find which filtervalue needs to be emptyd. The problem is that after emptying the filtervalue the datagrid 2 isn't being refreshed. So far we are unable to get the page refreshed. The data from the datagrid is being retrieve from Database.   We've tryed adding a nanoflow with a JavaScript action to refresh the datagrid but without success. We've tryed a couple of things from the client API, e.g.: - Reload - ui.reload - data.action - mx.ui.reload({ callback: () => resolve(true) });   As seen in idea https://community.mendix.com/link/space/widgets/ideas/2357 so far no default mendix option is available for emptying the filtervalue's and refreshing the datagrid.    Apart from the solution we tryed above we played with the idea of retrieving data by datasrouce MF. Within this DS the data would be retrieved  by a dynamic xpath based on filtervalue's and and JSON configuration property hidden = false. However, we are afraid this solution will by heavy on performance and maintenance.    I hope someone with experience on a similar problem can help us on a lightweight solution.    Kind regards,    TJ   
asked
1 answers
0

Hi TJ!

 

There's a hack to refresh filters without loading page. You can reset the filter value by hiding and showing the filter on page.

You can find a tutorial in my tutorial here: https://www.youtube.com/watch?v=LdGFNXFLj98&t=2s

answered