api.getTable()
Description
Gets the Table API instanceTable API provides control over the Table component associated with the Gantt chart.
Usage
getTable: (waitRender?: boolean) => Promise<ITableApi> | ITableApi;
Parameters
waitRender- iftrue, returns aPromisethat resolves once the Table API is fully initialized;falseis 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: