update-task
Description
Fires when updating a taskUsage
"update-task": ({
id: string | number,
task: Partial<ITask>,
diff?: number,
inProgress?: boolean,
eventSource?: string
}) => boolean | void;
Parameters
The callback of the update-task action can take an object with the following parameters:
id
- (required) the task IDtask
- (required) the tasks objectdiff
- (optional) the number of units for the start or/and end date values to be changed (in thetasks
object)inProgress
- (optional) if true, marks that the task update is in progresseventSource
- (optional) the name of an action that triggered the update
info
For handling the actions you can use the Event Bus methods
Example
The example below shows how to clear the task text when opening the Editor dialog for it.
<script>
import { getData } from "./common/data";
import { Gantt } from "@svar-ui/svelte-gantt";
const data = getData();
let api;
function clearTaskText() {
api.exec("update-task",
{ id: 3, task: { text: "" }
});
};
</script>
<Gantt
tasks={data.tasks}
bind:this={api} />
Related articles: How to access Gantt API