Page 1 of 1

[REACT] [Gantt] can create a button and use the Hide bar code on the click

Posted: Wed May 31, 2023 8:35 am
by sprabhu

Hi,
I am trying to implement 2 buttons which when will mimic the functionality of hide filter bar. One button will display the filter bar and 2nd button will hide it.

Also can we hide the filter bar on initial load and when we click the 1st button the filter bar will be visible?
And can we customize the row height of the filter bar?

Thanks


Re: [REACT] [Gantt] can create a button and use the Hide bar code on the click

Posted: Wed May 31, 2023 10:18 am
by tasnim

Hi,

I am trying to implement 2 buttons which when will mimic the functionality of hide filter bar. One button will display the filter bar and 2nd button will hide it.

Yes sure. You could hide and show the filter bar using these methods
https://bryntum.com/products/gantt/docs/api/Grid/feature/FilterBar#function-showFilterBar
https://bryntum.com/products/gantt/docs/api/Grid/feature/FilterBar#function-hideFilterBar

Also can we hide the filter bar on initial load and when we click the 1st button the filter bar will be visible?

Sure. You could hide the filterbar initially by setting hidden to true

    columns : [
        {
            type       : 'name',
            width      : 250,
            filterable : {
                filterField : {
                    type   : 'textfield',
                    hidden : true
                }
            }
        }
    ],

https://bryntum.com/products/gantt/docs/api/Grid/feature/FilterBar#enabling-filtering-for-a-column

And can we customize the row height of the filter bar?

You could set height field to a number to customize the height
https://bryntum.com/products/gantt/docs/api/Core/widget/TextField#config-height

    columns : [
        {
            type       : 'name',
            width      : 250,
            filterable : {
                filterField : {
                    type   : 'textfield',
                    height : 100,
                    hidden : true
                }
            }
        }
    ]

All The Best,
Tasnim


Re: [REACT] [Gantt] can create a button and use the Hide bar code on the click

Posted: Thu Jun 01, 2023 8:41 pm
by sprabhu

This is working now, Thanks a lot for your help