# Event Multi-Moving (JavaScript Scheduler) | DayPilot Pro for JavaScript Demo

> You can select multiple events (use Ctrl+click) and move all of them at once. Read more about [event multimoving](https://doc.daypilot.org/scheduler/event-multi-moving/) [doc.daypilot.org].

## Links

- Canonical HTML: /demo/scheduler/eventmultimoving.html
- Source HTML folder: /demo/scheduler/
- Catalog root: /demo/
- Catalog: /demo/llms.txt

## Source

### Inline demo script 1

```javascript
const dp = new DayPilot.Scheduler("dp", {
            startDate: "2026-01-01",
            scale: "Day",
            timeHeaders: [
                {groupBy: "Month"},
                {groupBy: "Cell"}
            ],
            days: 365,
            eventClickHandling: "Select",
            treeEnabled: true,
            resources: [
                {name: "Room A", id: "A"},
                {name: "Room B", id: "B"},
                {name: "Room C", id: "C"},
                {name: "Room D", id: "D"},
                {name: "Room E", id: "E"},
                {name: "Room F", id: "F"},
                {name: "Room G", id: "G"},
                {name: "Room H", id: "H"},
                {name: "Room I", id: "I"},
                {name: "Room J", id: "J"}
            ],
            onEventMoving: args => {
                if (args.overlapping) {
                    args.right.enabled = true;
                    args.right.html = "Conflict with an existing event!";
                }
            },
            onTimeRangeSelected: async args => {
                const modal = await DayPilot.Modal.prompt("New event name:", "Event");
                dp.clearSelection();
                if (modal.canceled) {
                    return;
                }
                dp.events.add({
                    start: args.start,
                    end: args.end,
                    id: DayPilot.guid(),
                    resource: args.resource,
                    text: modal.result
                });
                dp.message("Created");
            },
            allowEventOverlap: false,
            allowMultiMove: true,
            multiMoveVerticalMode: "All",
            onEventMoved: args => {
                console.log(args);
                dp.message("Events " + args.multimove.map(item => item.event.id()).join(', ') + " moved.");
            },
        });

        dp.init();
        dp.scrollTo("2026-03-25");


        const app = {
            init() {
                this.loadEventData();
            },
            loadEventData() {
                // generate and load events
                const events = [];

                for (let i = 0; i < 15; i++) {
                    const duration = Math.floor(Math.random() * 6) + 1; // 1 to 6
                    const durationDays = Math.floor(Math.random() * 6 + 2); // 2 to 7
                    const start = Math.floor(Math.random() * 6) + 2; // 2 to 7

                    const resId = String.fromCharCode(65 + i);

                    const disabledMoving = i === 3;
                    const additionalText = disabledMoving ? " (disabled)" : "";

                    const event = {
                        start: new DayPilot.Date("2026-03-25T00:00:00").addDays(start),
                        end: new DayPilot.Date("2026-03-25T12:00:00").addDays(start).addDays(durationDays).addHours(duration),
                        id: DayPilot.guid(),
                        resource: resId,
                        text: `Event ${i + 1} ${additionalText}`,
                        moveDisabled: disabledMoving,
                    };

                    events.push(event);
                }

                dp.update({events: events});
            }
        };
        app.init();
```

