Our pure JavaScript Scheduler component


Post by hbrizard »

Hello,

Understanding that from the doc, the Pan mode is : "NOTE: Incompatible with the EventDragCreate and the EventDragSelect features." :

Is it still possible to switch from Pan mode, to eventDragCreate mode, to eventDragSelectMode and so on dynamically after the Scheduler is instantiated ? One active mode at a time, and swapping in between them ?

I want the user to start on PAN but have the possibility to flip to DragCreate if he wishes, and then come back to PAN, while the scheduler is rendered.

IDEAL APPROACH :

switch (event.record.value) {
            case 1 : // Pan
                scheduler.features.pan = true;
                scheduler.features.eventDragCreate = false;
                scheduler.features.eventDragSelect = false;
                break;
            case 2 : // Drag Create
                scheduler.features.pan = false;
                scheduler.features.eventDragCreate = true;
                scheduler.features.eventDragSelect = false;
                break;
            case 3 : // Drag Select
                scheduler.features.pan = false;
                scheduler.features.eventDragCreate = false;
                scheduler.features.eventDragSelect = true;
                break;
        }
        

If so, how to do it ?

or it has to be done on the Scheduler Configuration before instantiating it, meaning I would need to destroy the scheduler and add it again with new feature config ?

NOT IDEAL APPROACH :

new SchedulerPro({
    ...
    features : {
        pan : true | false // based on param or cookie,
        eventDragCreate : true | false // based on param or cookie,
        eventDragSelect : true | false // based on param or cookie,
    },
    ... 
});

Thank you,

Hugo


Post by tasnim »

Hi Hugo,
First of all, you need to add these features with the disabled property inside like this:

features : {
	pan : { disabled : true },
	eventDragCreate : { disabled : true },
	eventDragSelect : { disabled : true },
}

Now while the scheduler is running. you can enable the features like this:

// to enable pan feature
scheduler.features.pan.disabled = false;

// to enable eventDragCreate feature
scheduler.features.eventDragCreate.disabled = false;

// to enable eventDragSelect feature
scheduler.features.eventDragSelect = false;

So this is how you can toggle them.


Post by hbrizard »

Wonderful! Many thanks !


Post Reply