request-data
Description
Fires when data for a task branch is requestedUsage
"request-data": ({
id: string
}) => boolean | void;
Parameters
The callback of the request-data action can take an object with the following parameters:
id
- (required) the task ID for which data is requested
info
For handling the actions you can use the Event Bus methods
Example
<script>
import { getData } from "./common/data";
import { Gantt } from "wx-svelte-gantt";
const data = getData();
let api;
$: if (api) {
api.on("request-data", ({ id }) => {
console.log("Data request for: " + id);
});
};
<script>
<Gantt
bind:api
tasks={data.tasks}
//other settings />
Related articles: How to access Gantt API