419
Views
9
Comments
Solved
[OutSystems Data Grid] How to disable the filter of all column
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi everyone,

I am using OutSystems Data Grid, I want to disable the filtering of all columns in my Grid. I found a discussion about disabling the filter by Column Id. However, in my application, I have to add columns dynamically. So I can't get the Id of the Column. Does anyone have an opinion on my situation? 

Thanks

2022-10-04 04-57-27
kdo
Solution

Hi everyone,

I used JS to iterate all columns from my Grid to Disable Filters. So I can solve my problem. Thank you for your efforts.

2022-06-06 09-58-43
Gourav shukla
2022-10-04 04-57-27
kdo

Hi Gourav,

Thanks for your information, I read the above thread but it seems to be a problem with the Data Grid and not the instructions to config. I didn't find a way to configure to disable filtering for my Grid.


2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi @kdo

Which DataGrid version are you using? Can you share a sample oml with what you've tried so far?

2022-06-06 09-58-43
Gourav shukla

Hi kdo,

            Check .OML file of that thread.

Thanks 

2022-10-04 04-57-27
kdo

Ah, I see the client actions. But in my case, I don't know how many columns I have. So I can't use client action to Deactivate Filter 

2022-10-04 04-57-27
kdo
Solution

Hi everyone,

I used JS to iterate all columns from my Grid to Disable Filters. So I can solve my problem. Thank you for your efforts.

UserImage.jpg
Han Chooi

Hi @kdo , good day. May I see your JS code please? I would like to do what you did too! Thanks.

2022-10-04 04-57-27
kdo

Hi @Han Chooi,

I am using the JS code below:

var grid = OutSystems.GridAPI.GridManager.GetActiveGrid();

grid.provider.formatItem.addHandler(function(s, e) {

            if (e.panel === s.cells) {

                var col = s.columns[e.col];

                grid.features.filter._filter.getColumnFilter(col).filterType = 0;

            }

        }

Regards,

Khoa

UserImage.jpg
Han Chooi

Thank you so much Khoa! Appreciate it.

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