Premium support for our pure JavaScript UI components


Post by turina »

Dear support,

With the react wrapper, is there a way to enable/disable features progammatically? With large schedule, we wish to provide the ability for our users to disable/enable features through our UI. More specially we wish to disable/enable timeRange and labels features.So far the only trick that we found is to add a boolean in the eventModel and then use it in the renderers of the label to return the label or "". But with this approach our scheduler is still much slower than with the labelsFeature disabled from the start. And we must update each event. Can you please advise if there is a better approach?

{
        labelLayoutMode: "default",
        left: {
            renderer: ({ eventRecord, domConfig }) => {
                if (eventRecord.displayAirports) {
                    return renderLeftLabel(eventRecord, domConfig, refScheduler?.current?.instance);
                } else {
                    return "";
                }
            },
        },
        right: {
            renderer: ({ eventRecord, domConfig }) => {
                if (eventRecord.displayAirports) {
                    return renderRightLabel(eventRecord, domConfig, refScheduler?.current?.instance);
                } else {
                    return "";
                }
            },
        },
    };

Post by saki »

Enabling and disabling features is demonstrated in this demo: https://bryntum.com/examples/scheduler/frameworks/react/javascript/simple/build/

Essentially it is creating a state variable and bind it to a Scheduler Component "Feature" property. Read the source code of the above demo to see it in details.


Post by turina »

Thanks Saki,

It was helpful. It works great now!


Post Reply