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:
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: