Our pure JavaScript Scheduler component


Post by tlapeg07 »

Hello,

I've been looking at your nice demo :
https://www.bryntum.com/examples/scheduler/groupsummary/

In this demo, you have consolidations for each group, which enables you to know how many resources are consumed depending on the time.

It's very nice, but...If you zoom in and shift a task a little bit, you can obtain something like this :
Consolidation.PNG
Consolidation.PNG (119.8 KiB) Viewed 1015 times
As you can see, the event "interviews" starts in the middle of a time slot, leading to an unconsistent consolidation which counts 2 during the whole interval, instead of 1 at the beginning and then 2. To be clear, what I would have like to get is this :
ConsolidationFixed.png
ConsolidationFixed.png (111.59 KiB) Viewed 1015 times
In Excel, you cannot have such an unconsistency, because events cannot start in the middle of a cell. It's somehow a restriction, but it ensures that the schedule and consolidations are always consistent :
Excel.PNG
Excel.PNG (8.01 KiB) Viewed 1015 times
My question is, how can I configure the scheduler to get consistent consolidations ?
Thank you in advance,
Best regards,

Post by pmiklashevich »

Please see timeResolution config on view presets registered in PresetManager. This is how scheduler knows the minimal step to drag your tasks with. To achieve what you want need to configure all timeResolution in all view presets to match bottom header.
  timeResolution      : {         // Dates will be snapped to this resolution
    unit        : 'hour',       // Valid values are 'millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'.
    increment   : 1
  },
When you zoom in/out the active view preset is changed. Please keep in mind that zooming feature and view presets are going to be refactored soon. https://app.assembla.com/spaces/bryntum/tickets/9325-make-a-store-of-presetmanager-to-handle-view-presets-and-zooming/details

You can disable zooming to make sure scheduler is consistent. Please see https://www.bryntum.com/docs/scheduler/#Scheduler/view/mixin/TimelineZoomable#config-zoomOnMouseWheel and https://www.bryntum.com/docs/scheduler/#Scheduler/view/mixin/TimelineZoomable#config-zoomOnTimeAxisDoubleClick

Pavlo Miklashevych
Sr. Frontend Developer


Post by tlapeg07 »

Hello,

Thank you for your reply, but it's still not clear to me whether or not it is possible to get what I want even with the newest version (2.3.0).
If it is possible, I do not understand how to do it, sorry :)

First of all, I realize my first post may be unclear. I do not want to disable zooming in/out, I want to forbid events to be changed so that they start/end between two units of my time precision (let's say the hour).

For instance, if I work on a month with a precision of one hour, then it will be mandatory to zoom in, just to distinguish events. But zooming in should not change the time precision : one hour. Then, for instance, if the user tries to postpone the event starting at 10am by 45 minutes to make it starts at 10:45am, then the event would be postponed by 1 hour instead and will start at 11am. You can see it as a dynamical rounding of starts and ends. Then of course, consolidations should be updated accordingly. When zooming in/out, it is ok if the timeRange header changes, because otherwise, it will be unreadable (each hours on a month or a year cannot be read on a screen). Therefore, On a month, the timeRange headers may be the weeks for instance and the days, if I zoom in, then it can move to days and hours, and then to hours and quarters, but I should never be able to make an event start/end between two hours.

I hope it is a bit clearer now :)
Do you see how to do it?

Post by pmiklashevich »

Hello,
Thank you for your reply, but it's still not clear to me whether or not it is possible to get what I want even with the newest version (2.3.0).
New zooming feature/preset manager will be available in 2.4 release.

Let me explain a bit how zooming works and the difference between current and upcoming versions. Basically zooming is switching between view presets. In old version zoom in/out tries to determine level, pick out a view preset which is close to the next/prev level, take its configs and create new view preset for zooming purposes. This behaviour is not transparent and it's easy to get confused. In new version there will no any "magic" calculations. PresetManager will be a Store. Zooming will take next/prev record from existing records in the PresetManager store and apply to the Scheduler.

We have some default predefined view presets (some of their configs might get changed in 2.4). To implement what you want you need to override our presets with your own. Each preset should follow next concept: timeResolution unit and increment should match the lowest header level. So you cannot drag a task on the half of the tick for example.

You can try to implement it now, but since zooming is not predictable now, we cannot guarantee the result. Though you can try to setViewPreset dynamically instead of zooming and see how different presets work in your case.

Cheers,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply