Hi,
I am using a React Grid to display some data where one of the underlying fields is a collection of objects. At present we join this into a comma-separated string server-side, and use the standard GridColumnMenuCheckboxFilter implementation with a text filter type. However, the resulting list of items in the filter menu is just a distinct list of the combination of underlying object names which can be quite long and doesn't take into account each object. Consider the following dataset:
[
{
"ProductID": 1,
"ProductName": "Product A",
"Categories": [
{
"CategoryID": "1",
"CategoryName": "Category A"
}
]
},
{
"ProductID": 2,
"ProductName": "Product B",
"Categories": [
{
"CategoryID": "1",
"CategoryName": "Category A"
},
{
"CategoryID": "2",
"CategoryName": "Category B"
}
]
},
{
"ProductID": 3,
"ProductName": "Product C",
"Categories": [
{
"CategoryID": "1",
"CategoryName": "Category A"
},
{
"CategoryID": "2",
"CategoryName": "Category B"
},
{
"CategoryID": "3",
"CategoryName": "Category C"
}
]
}
]
This would give us a Category column with three checkbox filter items: "Category A", "Category A, Category B" and "Category A, Category B, Category C" etc.
I would like to know if it's possible to generate a GridColumnMenuCheckboxFilter that contains the entire set of discrete categories from all product records such that selecting one category will return all product rows that have that category. Using the example above, the three checkbox filter items would be "Category A", "Category B" and "Category C". Selecting Category A would return all rows, selecting Category B would only return Product B and C, selecting Category C would only return Product C.
Assuming this is possible, would it also be possible to customise the sort behaviour?
Kind regards,
David