[Data Grid Reactive] [Data Grid Reactive] SetViewLayout & OnFilterChangEvent
Forge component by OutSystems R&D
Application Type
Reactive
Service Studio Version
11.11.3 (Build 43292)
Platform Version
11.12.0 (Build 29969)

I am currently using GetViewLayout and SetViewLayout to save and render data grid layout for every user (layout settings is stored in database).

After calling SetViewLayout the data grid was rendered perfectly but my problem is on the "Active Filters" displays. 

The "SetViewLayout" will not render the "Active Filters" display since it is a custom section outside of data grid. Hence I found a way to retrieve the filter definitions and call "OnFilterChangeEvent" for every filter.


By doing this I able to render the "Quick Filter(s)" block successfully with list of filter being applied as shown below. But when I try to click on "x" to remove the filter and error prompt and I cannot remove the filter successfully.


I noticed it was due to missing of "ColumnWidgetId" when I call OnFilterChangeEvent" in the "For Each" loop since there is no such details being stored in the view layout settings.


Does anyone have any idea or alternative approach I can resolve this?

Thanks!

Regards,
Soon

Solution

Hello @Soon ,

You did all the hard work, so let me share the missing part to be able to achieve this:

We did the same logic that you did, but instead of calling OnFilterChangeEvent we created the filters using a JS to get the column widget id using the Binding:

The JavaScript is quite simple:

Please keep mind, that this hasn't been tested for all possible use cases or that it cover all of your requirements, so we cannot assure that it will work for all use cases. 

In attachment, you can find a sample OML with this implementation.

Please let us know if this helps.

Bruno Martinho

Filters.oml

Hello @Soon 

We'll try to replicate this and let you know our conclusions.

We just need some time to do this analysis.

Thanks,

Bruno Martinho

Solution

Hello @Soon ,

You did all the hard work, so let me share the missing part to be able to achieve this:

We did the same logic that you did, but instead of calling OnFilterChangeEvent we created the filters using a JS to get the column widget id using the Binding:

The JavaScript is quite simple:

Please keep mind, that this hasn't been tested for all possible use cases or that it cover all of your requirements, so we cannot assure that it will work for all use cases. 

In attachment, you can find a sample OML with this implementation.

Please let us know if this helps.

Bruno Martinho

Filters.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.