Skip to main content

api.exec()

Description​

Allows triggering Gantt actions

Usage​

api.exec(
action: string,
config: object
): void;

Parameters​

  • action - (required) an action to be fired
  • config - (required) the config object with parameters (see the action to be fired)

Actions​

info

The full list of the Gantt actions can be found here

Example​

The example below shows how to clear the task text when opening the Editor dialog for it.

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

const data = getData();

const api = ref(null);

function clearTaskText() {
api.value.exec("update-task",
{ id: 3, task: { text: "" }
});
};

</script>

<template>
<Gantt :tasks="data.tasks" :onshoweditor="clearTaskText" ref="api" />
</template>

Related articles: