Datagrid 2 filter default value shows “1 item selected (but not applied)” and does not auto-filter

0
I have a Datagrid 2 on a page with multiple columns. One of these columns contains the name of the order creator name and uses a dropdown filter based on OrderCreator. My goal is to set the default value of this filter to the name of the currently logged-in OrderCreator, so that the grid initially only shows records for that user. What happens instead:The filter shows the message:“1 item selected (but not applied)”. The Datagrid is not filtered.   Things I have checked: The value of the variable exactly matches the value used in the filter The correct ordercreator object is being retrieved (same entity / same object type) The dropdown visually shows the correct user If I change the default value from variable to text, I get the same behavior and message. “1 item selected (but not applied)”   Even though the default value is visible and correct, the filter is not automatically “applied” on page load. Is this a known limitation of Datagrid 2?Is there a recommended way to explicitly trigger the filter (e.g. via microflow/nanoflow), or am I missing a configuration option? Any tips or best practices are welcome!    
asked
1 answers
0

In Data Grid 2, a default value only initializes the filter UI and does not trigger the datasource on page load. Therefore, the filter appears selected but is not applied. If you need the data to be filtered when the page first opens, this should be handled at the datasource level (XPath or datasource microflow), not via the Data Grid 2 filter itself. The cleanest way to manage this parametrically based on the selected creator is to introduce a FilterContext–like object for the grid. On page load, you set FilterContext/SelectedCreator to the CurrentUser; the grid’s datasource then retrieves data based on SelectedCreator when it is set, or all records when it is empty. When the user changes the Creator dropdown in the UI, the same SelectedCreator is updated and the grid automatically refreshes to show results for the newly selected user.

 

  • XPath datasource: Bind the constraint to the context selection (if SelectedCreator is set, apply OrderCreator = SelectedCreator; if not, do not apply the constraint).

  • Datasource microflow: Use FilterContext as a microflow parameter; if SelectedCreator is set, retrieve with OrderCreator = SelectedCreator, otherwise retrieve without filtering.

 

With this approach, the grid is filtered by the current user on initial load and seamlessly switches to the user-selected creator afterward, all driven by a single parameter.

answered