copy-row
Description
Fires when a row is copiedUsage
"copy-row": ({
id: string | number,
target: string | number,
mode?: "before" | "after",
eventSource?: string,
}) => boolean | void;
Parameters
The callback of the action takes an object with the following parameters:
id- (required) the ID of the row being copiedtarget- (required) the ID of the target rowmode- (optional) the position where the copied row will be placed:- "before" - before the target row
- "after" - after the target row (default)
eventSource- (optional) the name of the Grid action that triggered thecopy-rowevent
Example
import { Grid } from "@svar-ui/react-grid";
import { getData } from "./common/data";
const { data, columns } = getData();
function init(api) {
api.on("copy-row", (ev) => {
console.log("Row that is copied:", ev.id);
});
}
export default function App() {
return <Grid data={data} columns={columns} init={init} />;
}