Our blazing fast Grid component built with pure JavaScript


Post by prashantgoel »

This may be a very basic question. I would like the user to be able to toggle visibility of the filter bar on a tree grid by clicking a button. Do I use the toggleFilterBar function for this, and how do I invoke it? I tried looking in treegrid.features.headerMenu, but I'm probably looking in the wrong place.


Post by tasnim »

Hi,

Sure. To do so, you can toggle this prop https://bryntum.com/products/gantt/docs/api/Grid/feature/FilterBar#config-compactMode according to the button status

    tbar : [
        {
            type : 'button',
            text : 'Toggle filter bar',
            toggleable : true,
            onAction({ source }) {
                const grid = source.up('grid');
                grid.features.filterBar.compactMode = source.pressed;
            }
        }
    ]

Here is a gif demo

chrome_1sTDVNnL6Y.gif
chrome_1sTDVNnL6Y.gif (937.17 KiB) Viewed 79 times

Post Reply