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:

import { getData } from "../data";
import { Gantt } from "@svar-ui/react-gantt";

function App() {
const { tasks, links } = getData();

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

return <Gantt init={init} tasks={tasks} links={links} />;
}

Related articles: