redo
The functionality is available in PRO Edition only
PRODescription
Allows performing steps forward in historyIt's required to enable the undo property to perform the action.
Actions that can be undone: add-task, update-task, add-link, update-link, delete-task, delete-link, move-task, copy-task.
Hot key for the action: CTRL + Y
Usage
"redo": () => void;
Parameters
The callback of the action takes no parameters.
Example
We enable the redo action on a button click.
import { useRef } from "react";
import { Gantt } from "@svar/react-gantt";
import { Button } from "@svar-ui/react-core";
import { getData } from "../data";
export default function Example() {
const { tasks, links } = getData();
const apiRef = useRef(null);
function redo() {
apiRef.current?.exec("redo");
}
return (
<>
<Button onClick={redo}>Redo</Button>
<Gantt ref={apiRef} tasks={tasks} links={links} redo />
</>
);
}
Related articles: