DayPilot.Kanban.onSwimlaneMove

The onSwimlaneMove event handler fires when swim lane moving is finished, after the swim lane is dropped at the target position but before the swim lane is actually moved. You can cancel the move at this stage.

Declaration

DayPilot.Kanban.onSwimlaneMove(args)

Parameters

  • args.control (DayPilot.Kanban) - control instance

  • args.swimlane (object) - the swim lane being moved

  • args.position (number) - target position index

  • args.previous (object) - swim lane preceding the target position

  • args.next (object) - swim lane following the target position

  • args.preventDefault() - cancels the default action

Notes

The source data object is accessible as args.swimlane.data.

Examples

JavaScript

const kanban = new DayPilot.Kanban("dp", {
  swimlaneMoveHandling: "Update",
  onSwimlaneMove: (args) => {
    if (!confirm("Do you really want to move this swimlane?")) {
      args.preventDefault();
    }
  },
  // ...
});
kanban.init();

Angular

<daypilot-kanban [config]="config"></daypilot-kanban>
config: DayPilot.KanbanConfig = {
  swimlaneMoveHandling: "Update",
  onSwimlaneMove: (args) => {
    if (!confirm("Do you really want to move this swimlane?")) {
      args.preventDefault();
    }
  },
  // ...
};

React

<DayPilotKanban
  swimlaneMoveHandling="Update"
  onSwimlaneMove={onSwimlaneMove}
  {/* ... */}
/>
const onSwimlaneMove = (args) => {
  if (!confirm("Do you really want to move this swimlane?")) {
    args.preventDefault();
  }
};

Vue

<DayPilotKanban
  swimlaneMoveHandling="Update"
  @swimlaneMove="onSwimlaneMove"
  <!-- ... -->
/>
const onSwimlaneMove = (args) => {
  if (!confirm("Do you really want to move this swimlane?")) {
    args.preventDefault();
  }
};

See Also

DayPilot.Kanban.swimlaneMoveHandling

DayPilot.Kanban.onSwimlaneMoved

DayPilot.Kanban Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript