Premium support for our pure JavaScript UI components


Post by allemonh »

Hi,
I have created an application that requires two scheduler one of top of the other, separated by a splitter, similar to https://bryntum.com/products/scheduler/examples/drag-between-schedulers/ .
However, I would like for the top scheduler to grow when there are multiple events stacked in the top scheduler, so that the end users does not miss an event that would be hidden because the top scheduler is too narrow.
At first glance it looks like the splitter has a setXY method, however it does not seem to affect it in any way when I call it.
Here's the way I tried to implement it :


   ... (refs and states)
   useEffect(() => {
          splitterRef.current?.instance.setXY(0, 150)
    }, [unplannedEvents])
    useEffect(() => {
        if (scheduler1Ref?.current?.instance) {
            scheduler2Ref?.current?.instance.addPartner(scheduler1Ref.current.instance);
            setSchedulerInstance(scheduler1Ref.current);
        }
    }, []);
    return (
    <div id="content">
            <BryntumScheduler
                {...scheduler1Config}
                events={unplannedFlights}
                resources={[unplannedResource]}
                ref={scheduler1Ref}
            />
            <BryntumSplitter ref={splitterRef} onDrag={console.log} />
            <BryntumScheduler
                {...scheduler2Config}
                resources={resources}
                columns={columns}
                events={plannedEvents}
                ref={scheduler2Ref}
            />
        </div>
        )

Could you please point me in the right direction ?
Thank you
Hadrien


Post by kronaemmanuel »

Hi Hadrien,

Since splitters in that demo you showed are outside the scheduler, so It's not possible to position them, they're elements which are being controlled by the browser. You can however change the height of the schedulers itself. Please also take a look at: https://bryntum.com/products/scheduler/examples/split/, perhaps this can be more useful to you?

Regards,
Krona


Post Reply