show-editor
Description
Fires when opening the Editor dialog for a taskUsage
"show-editor": ({
id: string | number
}) => boolean|void;
Parameters
The callback of the show-editor action can take an array where each object has the following parameters:
id
- (required) the ID of the task for which the Editor dialog should be opened
info
For handling the actions you can use the Event Bus methods
Example
In the example below we use api.intercept()
to hide a default edit form by returning false.
import { useEffect, useRef } from "react";
import { getData } from "./common/data";
import { Gantt } from "wx-react-gantt";
import "wx-react-gantt/dist/gantt.css";
const MyComponent = () => {
const data = getData();
const apiRef = useRef();
useEffect(() => {
if (apiRef.current) {
apiRef.current.intercept("show-editor", (data) => {
return false;
});
}
}, [apiRef.current]);
return <Gantt apiRef={apiRef} tasks={data.tasks} />;
};
export default MyComponent;
Related articles: How to access Gantt API