Skip to main content

api.serialize()

Description

Serilizes and returns the list of current tasks in Gantt

Usage

api.serialize(): ITask[];

Returns

Returns an array of current tasks in Gantt: ITask[]. Each element in the array is the tasks object.

Example

The example shows how to serialize tasks and output them to console:

<script>
import { getData } from "../data";
import { Gantt } from "@svar-ui/svelte-gantt";

const data = getData();

function init(api) {
const tasks = api.serilalize();
console.log("Serialized tasks:", tasks);
}
</script>

<Gantt
tasks={data.tasks}
links={data.links}
{init}
/>

Related articles: