Skip to main content

api.getStores()

Description

Gets an object with the DataStore properties of Gantt

Usage

api.getStores(): object;

Returns

The method returns an object with the DataStore parameters:

{
data: DataStore // ( object of parameters )
}

Example

The example below shows how to output DataStore to the console:

import React, { useEffect, useRef } from "react";
import { Gantt } from "wx-react-gantt";
import { getData } from "./common/data";

const MyComponent = () => {
const apiRef = useRef();

useEffect(() => {
if (apiRef.current) {
const stores = apiRef.current.getStores();
console.log("DataStore:", stores);
}
}, [apiRef.current]);

return <Gantt ref={apiRef} tasks={data.tasks} links={data.links} />;
};

export default MyComponent;

Related articles: