Hi Bryntum,
I have two problems I want to overcome.
First is that at first Scheduler render as you can see on screenshot there is no column placeholder rendered and this is because we add it dynamically in useLayoutEffect using ref.current.instance.
After the useLayoutEffect starts to work we use such code, which adds a dynamic column to the scheduler. Column is not present, when Scheduler initially renders, and when it finally gets added it pushes to the right side timeline.
I want to achieve that there will be placeholder for a column, when column will get rendered there will be no layout shift.
useLayoutEffect(() => {
const schedulerInstance = schedulerSettings.getSchedulerInstance();
const unassignedSchedulerInstance = schedulerSettings.getSecondarySchedulerInstance();
if (shiftPreviewsData && schedulerInstance) {
// some other code for scheduler different mode
...
if (mode === SchedulerMode.EMPLOYEES && unassignedSchedulerInstance) {
const { resources, resourceTimeRanges } = mapAssigneeSummary(
shiftPreviewsData.assigneesSummary
);
schedulerInstance.resources = resources;
schedulerInstance.resourceTimeRanges = resourceTimeRanges;
schedulerInstance.events = shifts.assigned;
unassignedSchedulerInstance.events = shifts.unassigned;
if (schedulerInstance.columns instanceof ColumnStore) {
schedulerInstance.columns.removeAll();
schedulerInstance.columns.add(employeeColumns.assigned);
}
if (unassignedSchedulerInstance.columns instanceof ColumnStore) {
unassignedSchedulerInstance.columns.removeAll();
unassignedSchedulerInstance.columns.add(employeeColumns.unassigned);
}
} else {
schedulerInstance.resources = [];
schedulerInstance.events = [];
schedulerInstance.resourceTimeRanges = [];
}
}
}, [
locations,
mode,
schedulerSettings,
shiftPreviewsData,
shifts.assigned,
shifts.unassigned,
employeeColumns.assigned,
employeeColumns.unassigned,
]);
Second Topic one is that there are some unnecessary scrolls in the columns