Page 1 of 1

[VUE] How to hide option any in header context menu

Posted: Tue Jan 12, 2021 10:01 am
by sactory

I want to hide option any (Filter task, Hide filter bar,.......) in header context menu? Please support me. Thank you


Re: [VUE] How to hide option any in header context menu

Posted: Tue Jan 12, 2021 10:32 am
by pmiklashevich

Hello,

Please see the docs of the timeline header menu: https://www.bryntum.com/docs/scheduler/#Scheduler/feature/TimeAxisHeaderMenu
In the table you can find a reference for the Filter item. It is "eventsFilter". To remove it just configure the item as false.
See "Remove existing items" topic in the docs above. For example:

const scheduler = new Scheduler({
    features : {
        timeAxisHeaderMenu : {
            items : {
                eventsFilter : false
            }
        }
    }
});

The same is true for the header of the locked grid: https://www.bryntum.com/docs/scheduler/#Grid/feature/HeaderMenu
"Hide filter bar" reference is "toggleFilterBar". For example:

const scheduler = new Scheduler({
    features : {
        headerMenu : {
            items : {
                toggleFilterBar : false
            }
        }
    }
});

Please learn more in this guide: https://www.bryntum.com/docs/scheduler/#guides/customization/contextmenu.md

Best,
Pavel


Re: [VUE] How to hide option any in header context menu

Posted: Thu Jan 14, 2021 8:17 am
by sactory

Thank for answer, Next, I want to hide option (hide filter bar) in header context menu, but still keep filter bar. Please support me.
Note: We still use scheduler ver: 3.1.9


Re: [VUE] How to hide option any in header context menu

Posted: Thu Jan 14, 2021 9:08 am
by alex.l

Hi sactory,

Why the solution and guides provided by Pavel above doesn't work for you here? toggleFilterBar item is that you need. Or I misunderstood you?


Re: [VUE] How to hide option any in header context menu

Posted: Thu Jan 14, 2021 9:38 am
by sactory

Hi Alex.

In my code:
:header-context-menu-feature="false"
I was tried toogleFilter, but it didn't work


Re: [VUE] How to hide option any in header context menu

Posted: Thu Jan 14, 2021 12:50 pm
by alex.l

I see the problem now. In version 3.1.9 it's a bit harder to manipulate context menu items.

You need to pass a callback function as a config to your header-context-menu-feature. It may looks like this:

        headerContextMenu  : {
            processItems({ items }) {

            const index = items.findIndex(item => item.name === 'toggleFilterBar');

            if (index > -1) {
                items.splice(index, 1);
            }
        }
    },

This information is available in docs for HeaderContextMenu feature, but there is no online docs for old versions so I cannot provide you the link here. You can find it in your local docs version.

All the best,
Alex


Re: [VUE] How to hide option any in header context menu

Posted: Mon Jan 18, 2021 3:27 am
by sactory

Thank your answer, i did it.