Our pure JavaScript Scheduler component


Post by sactory »

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


Post 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

Pavlo Miklashevych
Sr. Frontend Developer


Post 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

Attachments
Screen Shot 2021-01-14 at 1.19.55 PM.png
Screen Shot 2021-01-14 at 1.19.55 PM.png (307.1 KiB) Viewed 914 times

Post 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?

All the best,
Alex


Post by sactory »

Hi Alex.

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

Attachments
Screen Shot 2021-01-14 at 2.34.17 PM.png
Screen Shot 2021-01-14 at 2.34.17 PM.png (379.19 KiB) Viewed 910 times

Post 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

All the best,
Alex


Post by sactory »

Thank your answer, i did it.


Post Reply