Filter defined on AG-DataGrid not on foundset of detailform

Hi

We have the following issue in TiNG (works in NG1!!!):

In our application we have a “table”-view and can switch to “detail”-view. The table view consists of a ag-datagrid. Both forms (table- and detail-view) based on the same foundset!

Now, when I define a filter on a column of the datagrid that for example results in one single record and then I switch to the detail-view that based on the same foundset, then I have no filters on the foundset of the detail view. I can see all records there! When I switch back to the table the filter is still there and only the one record that matches the filter criteria is visible. If I call "foundset.getFoundSetFilterParams() on the table-view-form then I can see that there is a filter with the name “ag-groupingtable”. When I check the same on the detail-view-form, then I get not filter-params at all.

If I do the same but instead of filtering on the datagrid I use svySearch to search for that record, then I have only this one record in the detail view, too.

What do we have to do, to get the same result like in old NG1 or svySearch-approach?

Thanks in advance for all hints.

Best
Roland

when you’re using the filter from the datagrid component, it is supposed to be applied only when the grid component is visible, so implementation wise, a foundset filter is used, with that specific name, “ag-groupingtable”, that is removed as soon as the grid is not visible anymore - this is how it should work also for ng1 in latest releases

Hi Gabi

Thanks for your reply!

We’ve used 2021.03 LTS for NG1. And there it was not like this. Obiously this behaviour changed in the meantime, but its definitly not what we or our customer would expect. When we have a filter on the table-view than this should be also applied to the corresponding detail-view. Otherwise the user clicks on the next button of the detail-view-toolbar unaware that he can come to records that should’t be visible when the filter is set on the grid. If we wouldn’t want it this way, we need to use named foundsets, I think. But as long as we use the same foundset, all filters that are applied on it should be used all over the solution. At least it used to be like that in 2021.03, also in other circumstances (not only table-view / detail-view). I hope this is not a fundamental behaviour change of Servoy.

Best
Roland

this is a change because there are many customers that don’t expect that
And it could even be that this was a related foundset where somebody did a search over, then that relation instance (of that specific parent record) was suddenly changed

So this is by customer request that filtering in a UI component like AGGrid stays filters only for that component and that internal added filter by that component doesn’t keep hanging around for ever…
Customers just didn’t expect that that suddenly after a while somewhere in the solution they did see a (related)foundset that was not showing all of its records.

So only if you as a developer add filters you are responsible, but if components add internal filters they are responsible. so then the component is responsible of clearing it up.

its already more then 2 years like that in our code (since 2022.09 release)

We could potentially introduce a boolean property on nggrid “keep filers” and then we don’t remove it. but this can be dangerous. for example you have 2 lists 1 is orders below is order_details of that list
then people filter over order details, and then go to the next order in the top list, what state should that order_details related foundset of that previous order be in? filtered?? (then that specific instance is suddenly throughout the code always filters)

For now, we do it with the following workaround:

When we switch from table- to detailview in the onHide of the table-view-form we store the current-settings of the “ag-groupingtable”-filter (foundset.getFoundSetFilterParams(“ag-groupingtable”)) and in the onShow-Event of the detail-view-form we set this filter on the foundset (foundset.addFoundSetFilterParam(…)). So we have more or less the same behaviour as we had in NG1 (2021.03 LTS).