Our state of the art Gantt chart

Post by jhughesoneplan »

How can I do a filter for an array of arrays (with an OR):

Example my data contains
row1: ['value1','value2']
row2: ['value3']

    "property": "col",
    "value": [
    "operator": "includes"

If I do this then that MUST contain value1 AND value3. What I want is anything that contains either value1 or value3. Is there a way to do this with the standard filters?

Post by marcio »

Hello jhughesoneplan,

You can use the filterBy like you'll see here https://bryntum.com/products/grid/docs/api/Core/data/mixin/StoreFilter

    id : 'my filter',
    filterBy : record => record. col === 'value1' || record. col === 'value3'

Best regards,

Post by jhughesoneplan »

I am using an in house filter control and it can build multiple filters. The result could be something like this:

        "property": "PercentDone",
        "value": 50,
        "operator": "="
        "property": "MC1",
        "value": [
        "operator": "includes"

In order for me to use a function I believe I would have to rewrite how that filter works into a function to be used. Or can I append on a custom function onto a filter array? For instance my PercentDone filter works fine but he MC1 is the custom one.

Post by alex.l »


A filters array may contain methods together with operator formatted items. Please see https://bryntum.com/products/schedulerpro/docs/api/Core/data/mixin/StoreFilter#config-filters
So you can use it as you did with array, but MC1 needs to be updated to use filterBy callback method

All the best,

Post Reply