Skip to main content

api.getTable()

Description

Gets the Table API instance

Table API provides control over the Table component associated with the Gantt chart.

Usage

getTable: (waitRender?: boolean) => Promise<ITableApi> | ITableApi;

Parameters

  • waitRender - if true, returns a Promise that resolves once the Table API is fully initialized; false is set by default (returns the API synchronously when possible).

Returns

Depending on the waitRender parameters and initialization stage, the method returns: ITableApi|Promise

Example

Waiting for initialization:

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

const { tasks, links } = getData();

function init(api) {
api.getTable(true).then((tableApi) => {
console.log("Table API:", tableApi);
});
}

</script>

<Gantt {init} {tasks} {links} />

Related articles: