Our pure JavaScript Scheduler component


Post by brandonl »

Hi,

I have the following code as an item in my eventContextMenu. Within this item there is a submenu which is populated with several items. The default behaviour is for this submenu to open on hover, but I would like to switch that so that it happens on click. I've tried changing the "autoShow" and "showOnClick" properties, but neither seems to make a difference. I'm sure that I'm missing something, but is it possible do what I'm asking (show a submenu on click)?

Using scheduler version 2.2.5.
   {
     text: "Schedule",
     name: "schedule",
     menu: {
       items: generateItems(),
       showOnClick: true
     }
   }
Thanks,
Brandon

Post by sergey.maltsev »

Hi!

We have this config for the menu
https://www.bryntum.com/docs/grid/#Core/widget/Menu#config-focusOnHover

But in current release it is not available for context menus yet.

It is available for upcoming version which is accessible from Customer Zone for registered users. Builds suffixed with next.

For example this code will work there.
features : {
    eventContextMenu : {
        menuConfig : {
            focusOnHover : false
        },
        ...
    }
},
For current release you could use eventContextMenuShow event to setup menu.
https://www.bryntum.com/docs/scheduler/#Scheduler/feature/EventContextMenu#event-eventContextMenuShow

Check this demo
https://bryntum.com/examples/Scheduler/eventcontextmenu/

Add this code to the end and see effect.
scheduler.on('eventcontextmenushow', ({ menu }) => {
    menu.focusOnHover = false;
});
alternate config option
const scheduler = new Scheduler({
...
    listeners : {
        eventContextMenuShow({ menu }) {
            menu.focusOnHover = false;
        }
    }
});

Post Reply