Our pure JavaScript Scheduler component


Post by Jerome Cauchon »

Hi,
i'm trying to figure how the scheduler pro can pass the start and end date when calling the project load manually. I have set the passStartEndParameters as true but unfortunately, the dates are not passed in the request. What i'm doing wrong?

Here's my scheduler code. I can can provide you a runnable example if you prefer!

const App: FunctionComponent = () => {
  const schedulerRef = useRef<typeof BryntumSchedulerPro | null>(null);
  const schedulerConfig = {
    startDate: new Date(2018, 1, 7, 8),
    endDate: new Date(2018, 1, 7, 22),
    viewPreset: "weekAndDayLetter",
    passStartEndParameters: true,
    project: {
      autoLoad: false,
      writeAllFields: true,
      transport: {
        load: {
          url: `data/data.json`,
        },
      },
    },
    columns: [
      {
        type: "resourceInfo",
        text: "Staff",
        width: 130,
      }
    ],
  };

  // load and set data
  useEffect(() => {
    const project = schedulerRef.current.instance.project;
    project.load();
  }, []);

  return (
    <Fragment>
      <BryntumSchedulerPro ref={schedulerRef} {...schedulerConfig} />
    </Fragment>
  );
};

export default App;

Post by alex.l »

Hi Jerome,

https://bryntum.com/docs/scheduler-pro/api/Scheduler/view/mixin/SchedulerStores#config-passStartEndParameters
applies startDate/endDate of the project to the store load, not the project itself.

It's not supported now, I've created a feature request to add this: https://github.com/bryntum/support/issues/3839

Now you could pass it as params of project.load() method:

project.load({startDate : date1, endDate : date2})

https://bryntum.com/docs/scheduler-pro/api/Scheduler/data/mixin/ProjectCrudManager#function-load

All the best,
Alex


Post by Jerome Cauchon »

Thanks Alex. It's exactly what we are doing in our app. We have a custom date picker for our scheduler and when we are setting dates on the scheduler, the scheduler changes start and end dates to match the weekAndDayLetter viewPreset. So our date range request is smaller than the date range of the view. So i'm trying to find where a should call my manual load. Is the scheduler raise an event when the date range changed to trigger the manual load?

Thanks


Post by alex.l »

All the best,
Alex


Post by alex.l »

Btw, you could disable auto adjust with this config https://bryntum.com/docs/scheduler-pro/api/Scheduler/view/TimelineBase#config-autoAdjustTimeAxis

You can set this option to false to make the timeline panel start and end on the exact provided startDate/endDate w/o adjusting them.

All the best,
Alex


Post by Jerome Cauchon »

Thanks Alex. I'll try it!


Post Reply