Our pure JavaScript Scheduler component


Post by lucaas »

Hi,

I understand that it may be difficult to combine the event drag select and drag create functionality by default since they use the same interaction.

I attempted to switch between the features at runtime on keypress, but didn't succeed in doing so, and imagine that it isn't supported?

Here is a snippet of what I was trying to achieve:
    handleKeyUp(e) {
        if (e.key === 'Meta' || e.key === 'Control') {
            this.schedulerEngine.features.eventDragSelect = false;
            this.schedulerEngine.features.eventDragCreate = true;
        }
    }

    handleKeyDown(e) {
        if (e.key === 'Meta' || e.key === 'Control') {
            this.schedulerEngine.features.eventDragSelect = true;
            this.schedulerEngine.features.eventDragCreate = false;
        }
    }

Post by saki »

Unfortunately, this is not currently supported. It is possible that we will consider adding this functionality in the future.

Features that are configured "true" or "false" at in the configuration are converted to instances of their classes at runtime so setting them back to booleans leads to unpredictable results.

Post by lucaas »

Just to double-check, there is no other way to switch features at runtime? E.g. deregister one plugin instance and register another one.

Post by mats »

You could just clone our sources and create your own feature that works just like you want it

Post by lucaas »

At the moment, I don't think it is enough of a priority for us to create a custom feature but thanks for the tip, I didn't think of that. Thanks!

Post Reply