Our pure JavaScript Scheduler component


Post by kanimozhi »

Hi, We need to override the feature of zooming the scheduler chart using ctrl key and mouse scroll. We want to zoom the scheduler only by using the mouse scroll and not using ctrl key. Please provide the attribute to enable this feature .

Thanks,
Kanimozhi

Post by mats »

Not supported at the moment I’m afraid.

Post by kanimozhi »

Please give the alternate option to achieve this feature ....

Thanks,
Kanimozhi

Post by sergey.maltsev »

Hi!

You can use wheel event to implement it by yourself.
It is simple with EventHelper.
https://www.bryntum.com/docs/scheduler/#Common/helper/EventHelper
EventHelper.on({
    element : scheduler.subGrids.normal.element,
    wheel   : (event) => {
        event.preventDefault();
        event.deltaY > 0 ? scheduler.zoomOut() : scheduler.zoomIn();
    },
    thisObj : scheduler
});
Use zoomOnMouseWheel : false to disable build-in mouse wheel zooming.
https://www.bryntum.com/docs/scheduler/#Scheduler/view/mixin/TimelineZoomable#config-zoomOnMouseWheel

Post by kanimozhi »

Hi, Thanks for your solution. But where i need to use this code ?

Am getting the below syntax error.
Attachments
EventHelper.png
EventHelper.png (8.79 KiB) Viewed 1271 times

Post by Maxim Gorkovsky »

Hello.
You need to use this code anywhere after scheduler is instantiated and rendered, so
scheduler.subGrids.normal.element
would return actual DOM element.
Also it appears you IDE doesn't know about arrow functions in JS, try to replace it with a regular fn:
wheel : function (event) { ... }

Post Reply