Our blazing fast Grid component built with pure JavaScript


Post by yahor_guru »

Hi,
Thanks for fix viewtopic.php?f=43&t=27650&p=138478#p138478

I have another question about filtering.
I try to apply multiple filters for one column by default.
In the example(https://bryntum.com/products/grid/examples/filtering/) try apply following filter:

features : {
        filter    : [
           {
              property : 'age',
              operator : '>',
              value : '20'
           },
           {
              property : 'age',
              operator : '<',
              value : '50' }
           ],
        stripe    : true,
        quickFind : true
    },
....

It applies only the latest one.
Is it an issue? or should i do that with FilterStore? Thanks.

Attachments
Screenshot 2024-02-06 at 11.47.49.png
Screenshot 2024-02-06 at 11.47.49.png (319.74 KiB) Viewed 323 times

Post by tasnim »

Hi,

You should set filters inside of the store https://bryntum.com/products/grid/docs/api/Core/data/Store#config-filters

store : {
	filters : [...]
}

This should be working


Post by yahor_guru »

The same issue, but now used first filter.
Checked with demo dashboard


const grid = new Grid({

    appendTo : 'container',

    features : {
        filter    : true,
        stripe    : true,
        quickFind : true
    },
    store: {
        filters: [
           {
              property : 'age',
              operator : '>',
              value : '22'
           },
           {
              property : 'age',
              operator : '<',
              value : '50'
            }
        ]
    },
    ...

Post by tasnim »

Hi,

It works fine here. How can we reproduce the issue you're facing?

Attachments
Screenshot 2024-02-06 173143.png
Screenshot 2024-02-06 173143.png (99.02 KiB) Viewed 310 times

Post by yahor_guru »

Rechecked, it works, yes.
Thanks.


Post by yahor_guru »

Oh, actually not. It's broken as i said.
In your example if you click on filter button it will show only one filter and after tooltip is broken, it shows 2 the same filters


Post by tasnim »

Hi,

Thank you very much for the report. We'll investigate it. Here is the ticket to track progress https://github.com/bryntum/support/issues/8482

Best regards,
Tasnim


Post by yahor_guru »

Can i disable multiple filters per column? I mean allow users to make only one filter per column.


Post by tasnim »

Sure, you can hide the add filter button by setting https://bryntum.com/products/grid/docs/api/Grid/widget/GridFieldFilterPickerGroup#config-showAddFilterButton to false

features : {
        filter    : { property : 'city', operator : '=', value : 'Paris', pickerConfig : { showAddFilterButton : false } },

Best regards,
Tasnim


Post by emil »

Hi,

When providing multiple filters for the same property, an id is required on the filter, because by default the property name is used as the filter ID.

Please try:

store: {
    filters: [
        {
            id : 'age>',
            property : 'age',
            operator : '>',
            value : '22'
        },
        {
            id : 'age<',
            property : 'age',
            operator : '<',
            value : '50'
        }
    ]
}

Post Reply