We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version details : "react": "^18.3.1", "react-data-grid": "^7.0.0-beta.46",
code : import React, { useState } from "react"; import DataGrid from "react-data-grid"; import "react-data-grid/lib/styles.css"; const App = () => { const [rows, setRows] = useState([ { id: 1, title: "Row 1", count: 20 }, { id: 2, title: "Row 2", count: 40 }, { id: 3, title: "Row 3", count: 60 }, ]);
const columns = [ { key: "id", name: "ID" }, // Not editable { key: "title", name: "Title", editable: true }, // Editable column { key: "count", name: "Count", editable: true }, // Editable column ];
const rowKeyGetter = (row) => row.id;
const handleRowsChange = (updatedRows, { indexes }) => { console.log("Updated Rows:", updatedRows); // Debug: Log the new rows const newRows = [...rows]; indexes.forEach((index) => { newRows[index] = { ...newRows[index], ...updatedRows[index] }; }); setRows(newRows); // Update state };
return ( <div style={{ height: 300 }}> ); };
export default App;
Kindly help me with documentation to utilise the features of react-data-grid with react 18 version.
The text was updated successfully, but these errors were encountered:
Can you create a reproducible example?
Sorry, something went wrong.
No branches or pull requests
version details :
"react": "^18.3.1",
"react-data-grid": "^7.0.0-beta.46",
code :
import React, { useState } from "react";
import DataGrid from "react-data-grid";
import "react-data-grid/lib/styles.css";
const App = () => {
const [rows, setRows] = useState([
{ id: 1, title: "Row 1", count: 20 },
{ id: 2, title: "Row 2", count: 40 },
{ id: 3, title: "Row 3", count: 60 },
]);
const columns = [
{ key: "id", name: "ID" }, // Not editable
{ key: "title", name: "Title", editable: true }, // Editable column
{ key: "count", name: "Count", editable: true }, // Editable column
];
const rowKeyGetter = (row) => row.id;
const handleRowsChange = (updatedRows, { indexes }) => {
console.log("Updated Rows:", updatedRows); // Debug: Log the new rows
const newRows = [...rows];
indexes.forEach((index) => {
newRows[index] = { ...newRows[index], ...updatedRows[index] };
});
setRows(newRows); // Update state
};
return (
<div style={{ height: 300 }}>
);
};
export default App;
Kindly help me with documentation to utilise the features of react-data-grid with react 18 version.
The text was updated successfully, but these errors were encountered: