Skip to main content

show-conflicts

PRO

The functionality is available in PRO Edition only

Description​

Fires when opening or closing the list of scheduling conflicts

info

The action works only if auto scheduling is enabled.

The action sets the showConflicts state, which opens or closes the ConflictReport list. The Conflicts button of the Toolbar and the close icon of the list both trigger it.

Usage​

"show-conflicts": ({
mode?: boolean
}) => boolean | void;

Parameters​

The callback of the show-conflicts action takes an object with the following parameter:

  • mode - (optional) true opens the list, false closes it; if not set, the list is toggled
info

For handling the action you can use the Event Bus methods. Returning false from the action handler will block the action (see Preventing actions)

Example​

The example below opens the list of conflicts whenever a scheduling run reports any.

<script setup>
import { ref } from "vue";
import { getData } from "./common/data";
import { Gantt, ConflictReport } from "@svar/vue-gantt";

const data = getData();

const api = ref(null);

function init(api) {
api.on("set-conflicts", ({ conflicts }) => {
if (conflicts.length) api.exec("show-conflicts", { mode: true });
});
}
</script>

<template>
<Gantt
ref="api"
:tasks="data.tasks"
:links="data.links"
:schedule="{ auto: true }"
:init="init"
/>
<ConflictReport :api="api" />
</template>

Related articles: