Can you please explain the relationship between Preset and Zoom ?
My issue is i want smooth incremental zoomIn and zoomOut. I know there are functions, but those functions zoom very rapidly, from one zoom level to the next level, there is a lot of info which will be missed by the default zoomIn and zoomOut function, so we are trying to build our own zooming function. So if you can guide us in that case, that will also be appreciated.
Support Forum
Hi s-tech,
Zooming in Gantt is nothing else than switching between ViewPresets defined as array in https://bryntum.com/docs/gantt/api/Gantt/view/Gantt#config-presets
We have pre-defined set of presets. To get it just try gantt.presets
. To configure it, you can use your own set of ViewPresets.
You can also define your own ViewPreset, for that you'll need to register it using PresetManager
docs:
https://bryntum.com/docs/gantt/api/Scheduler/view/mixin/TimelineZoomable
https://bryntum.com/docs/gantt/api/Scheduler/preset/PresetManager
https://bryntum.com/docs/gantt/api/Scheduler/preset/ViewPreset
We have example for Scheduler here https://bryntum.com/examples/scheduler/configuration/
It might be useful to review the source code to see how it works.
All the best,
Alex
Hello,
gantt.presets
is a store https://bryntum.com/docs/gantt/api/Gantt/view/Gantt#property-presets
https://bryntum.com/docs/gantt/api/Scheduler/preset/PresetStore
You can get item by index and tune that record as you need, or initially set it with your dataset, where may be default presets together with your own presets. You can find examples in docs I linked above.
https://bryntum.com/docs/gantt/api/Scheduler/preset/PresetStore#function-getAt
All the best,
Alex