12
Views
4
Comments
Solved
[Data Grid Web] How to customize Filter
Forge component by OutSystems R&D
41
Published on 14 Dec 2020
Application Type
Traditional Web

Hi everyone

How to customize a filter for a special type or column.

I know in the Wijimo that DataGrid base on, You can easily achieve this. Please refer to this link

But I don't know how to do this in Outsystem without clone the complete DataGrid component.

Any suggestion is appreciated.

Kind Regards

Staff
Rank: #481
Solution

Hello @Tom Zhao,

Thank you for bringing this topic to the discussion.

If I understood correctly, you just want to customize the options that come along with the filter, depending on the type of the column just like Wijmo is doing here.

Let me know if this helps:

Inside your Web Screen > Advanced > Javascript, try to add the following code:

var Operator = wijmo.grid.filter.Operator;
wijmo.culture.FlexGridFilter.stringOperators = [
    { name: '(not set)', op: null },
    { name: 'Custom Equal', op: Operator.EQ },
    { name: 'Custom Different', op: Operator.NE },
    { name: 'Custom Bigger', op: Operator.GT },
    { name: 'Custom Smaller', op: Operator.LT }
];

If you then config your columns to use the FilterType = Entities.FilterType.Condition or Entities.FilterType.Both, you will be able to see the Custom options inside your filter.

I attached a sample to this message. You can take a look if you want to get a better look.

This should be enough to customize your filter.

Thank you,

Tiago Pereira


DataGridCustomFilterOptions.oml

Rank: #287

Hi Tiago  

This exactly solves my problem. Thanks a lot.

May  I ask one more question?

Is it possible to change the filter not for a special type but for the special column?

Best Regards,

Staff
Rank: #481

Hello @Tom Zhao,

regarding your second question, I've been trying to find a solution for your question. I've been trying to use the handler filterChanging but without 100% success because this is a really advanced use case. 

Maybe this handler is a good start for you to explore.

Best regards,

Tiago Pereira



Rank: #287

Hi Tiago  

Thank you very much. I will try your suggestion.

Thanks again.

Best Regards,