'Filtering on paired values in AG-Grid

I have a column that combines two fields into one label. The data fields used by the column look like this:

{
    'priority': "Some Priority Value",
    'tag': "A Tag Name",
}

Example data:

Tag    Priority
---------------
ABC    High
ABC    Medium
DEF    High
GHI    Low

These values get rendered as labels in the column. Examples would include ABC (High), and GHI (Low). I'd love to be able to allow the user to filter on either the tag or the priority in this column.

For example, if the user filtered on a priority of "High", they'd see entries containing ABC (High) and DEF (High), using the data set above. If they filtered on "ABC", they'd see entries containing ABC (High) and ABC (Medium).

How best can this be done? Is a custom filtering UI the best bet?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source