EventDragSelect

Enables users to click and drag to select events (or assignments in multi assignment mode) inside the Scheduler's timeline. Press CTRL/CMD to extend an existing selection.

The selection rectangle element is styled using the CSS class name b-drag-select-rect. You may use application CSS to change its appearance from the default.

Event drag select
//<code-header>
fiddle.title = 'Event drag select';
//</code-header>
const scheduler           = new Scheduler({
    appendTo : targetElement,

    // makes scheduler as tall as it needs to be to fit rows
    autoHeight : true,

    startDate : new Date(2022, 4, 6),
    endDate   : new Date(2022, 4, 13),

    columns : [
        { field : 'name', text : 'Name', width : 100 }
    ],

    resources : [
        { id : 1, name : 'Bernard' },
        { id : 2, name : 'Bianca' }
    ],

    events : [
        { id : 1, resourceId : 1, name : 'Drag in schedule to select', startDate : '2022-05-04', endDate : '2022-05-09' },
        { id : 2, resourceId : 1, name : 'Press meeting', startDate : '2022-05-11', endDate : '2022-05-14' },
        { id : 3, resourceId : 2, name : 'Audition', startDate : '2022-05-07', endDate : '2022-05-09' },
        { id : 4, resourceId : 2, name : 'Script deadline', startDate : '2022-05-11', endDate : '2022-05-11' }
    ],

    features : {
        eventDragSelect : true,
        eventDragCreate : false
    }
});

This feature is disabled by default. For info on enabling it, see GridFeatures.

Incompatible with the EventDragCreate and the Pan features.

const scheduler = new Scheduler({
  features : {
    eventDragSelect : true,
    eventDragCreate : false
  }
});

Configs

10

Common

disabledInstancePlugin
listenersEvents

Other

Configure as true to include nested events in the selection. Only applies to SchedulerPro, when using nested events. When false only parent events and events without nesting will be selected.

Marque selection cannot be started inside a parent event, and marque selecting a nested event will always also select the parent event.

const scheduler = new SchedulerPro({
    features : {
        nestedEvents : true, // Enable nested events
        eventDragSelect : {
            includeNested : true // Include nested events in the selection
        }
    }
});

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

17

Common

disabledInstancePlugin

Class hierarchy

isEventDragSelect: Boolean= truereadonly
Identifies an object as an instance of EventDragSelect class, or subclass thereof.
isEventDragSelect: Boolean= truereadonlystatic
Identifies an object as an instance of EventDragSelect class, or subclass thereof.
isDelayableDelayable
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable

Other

Configure as true to include nested events in the selection. Only applies to SchedulerPro, when using nested events. When false only parent events and events without nesting will be selected.

Marque selection cannot be started inside a parent event, and marque selecting a nested event will always also select the parent event.

const scheduler = new SchedulerPro({
    features : {
        nestedEvents : true, // Enable nested events
        eventDragSelect : {
            includeNested : true // Include nested events in the selection
        }
    }
});

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Functions

29

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

createOnFrameDelayable
LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Events

8

Fires on the owning Scheduler after the selection is finished.

// Adding a listener using the "on" method
eventDragSelect.on('afterEventDragSelect', ({ source }) => {

});
ParameterTypeDescription
sourceSchedulerBase

The Scheduler instance

Fires on the owning Scheduler before drag selection starts. Return false to prevent the operation.

// Adding a listener using the "on" method
eventDragSelect.on('beforeEventDragSelect', ({ source, event }) => {

});
ParameterTypeDescription
sourceSchedulerBase

The Scheduler instance

eventEvent

The native browser DOM event

Fires on the owning Scheduler when the selection area is updated.

// Adding a listener using the "on" method
eventDragSelect.on('eventDragSelect', ({ source, startDate, endDate, rectangle, selectedAssignments, selectedEvents }) => {

});
ParameterTypeDescription
sourceSchedulerBase

The Scheduler instance

startDateDate

The start date of the selection area

endDateDate

The end date of the selection area

rectangleRectangle

The rectangle of the selection area

selectedAssignmentsAssignmentModel[]

The selected assignments

selectedEventsEventModel[]

The selected events

catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

8

Called on the owning Scheduler after the selection is finished.

new EventDragSelect({
    onAfterEventDragSelect({ source }) {

    }
});
ParameterTypeDescription
sourceSchedulerBase

The Scheduler instance

Called on the owning Scheduler before drag selection starts. Return false to prevent the operation.

new EventDragSelect({
    onBeforeEventDragSelect({ source, event }) {

    }
});
ParameterTypeDescription
sourceSchedulerBase

The Scheduler instance

eventEvent

The native browser DOM event

Called on the owning Scheduler when the selection area is updated.

new EventDragSelect({
    onEventDragSelect({ source, startDate, endDate, rectangle, selectedAssignments, selectedEvents }) {

    }
});
ParameterTypeDescription
sourceSchedulerBase

The Scheduler instance

startDateDate

The start date of the selection area

endDateDate

The end date of the selection area

rectangleRectangle

The rectangle of the selection area

selectedAssignmentsAssignmentModel[]

The selected assignments

selectedEventsEventModel[]

The selected events

onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

2

CSS variables

4
NameDescription
--b-event-drag-select-border-widthMarquee selection border width
--b-event-drag-select-border-styleMarquee selection border style
--b-event-drag-select-border-radiusMarquee selection border-radius
--b-event-drag-select-border-colorMarquee selection border color