Premium support for our pure JavaScript UI components


Post by damir »

Is possible to get the current shiftPrevious and shiftNext value?

Thanks


Post by mats »

Do you mean the Gantt startDate?


Post by damir »

I mean when we call this two methods:

gantt.shiftPrevious();

gantt.shiftNext();

Post by ghulam.ghous »

Hi damir,

I believe you are looking for the values by which the project start date is shifted forward. When no value is passed to shiftPrevious method, shiftIncrement https://bryntum.com/products/gantt/docs/api/Scheduler/preset/ViewPreset#field-shiftIncrement is used. The unit for this can be checked here https://bryntum.com/products/gantt/docs/api/Scheduler/preset/ViewPreset#field-shiftUnit.

Screenshot 2024-03-19 at 7.17.41 PM.png
Screenshot 2024-03-19 at 7.17.41 PM.png (22.3 KiB) Viewed 147 times

Regards,
Ghous


Post by damir »

Thanks for your reply.

I believe you are looking for the values by which the project start date is shifted forward.

Not to shift project start date, but to move the gantt timeline, the project start date remain the same.

It seems that gantt.timeAxis.shiftPrevious(); and gantt.shiftPrevious(); are doing the same thing, however I can't get shiftIncrement from "gantt.timeAxis.shifIncrement" (TS2339: Property  shifIncrement  does not exist on type  TimeAxis).

My viewPreset is 'weekAndDayLetter', so I suppose by default is 1 and it should be fine the default.

What I need is to know the current status of shifting, should I count how many times user click on shift prev/next or is there a way to retrieve it like for example to retrieve the current zoom level using gantt.zoomLevel.

Thanks


Post by alex.l »

Hi damir,

Unfortunately we do not count how many times user shifted timeline, you will need to implement this behaviour yourself.
Btw, to get shiftIncrement in TypeScript, try to get it from viewPreset property. https://bryntum.com/products/gantt/docs/api/Scheduler/preset/ViewPreset#field-shiftIncrement
It is still not clear what is the "status of shifting"

All the best,
Alex


Post by damir »

All right, thanks!


Post Reply