[VUE] How to hide option any in header context menu
I want to hide option any (Filter task, Hide filter bar,.......) in header context menu? Please support me. Thank you
I want to hide option any (Filter task, Hide filter bar,.......) in header context menu? Please support me. Thank you
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
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
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?
Hi Alex.
In my code:
:header-context-menu-feature="false"
I was tried toogleFilter, but it didn't work
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
Thank your answer, i did it.