Hello there,
I have this handsontable:
There is a list of “Project Team Members” [1.] (at the moment 1-8).
What I’d like is that clicking the button [2.] adds a new member row at the bottom of the table (“Project Team Members | 9”, etc.).
The code:
// Columns
const colHeaders = [["Surname", "Name", "Contact phone", "Contact email", "Belt (-/YB/GB/BB)"],];
// Rows
const rowsHeaders = [
"Project Leader",
"Process Owner",
"Project Sponsor",
"Finance Belt",
"Project Team Members | 1",
"Project Team Members | 2",
"Project Team Members | 3",
"Project Team Members | 4",
"Project Team Members | 5",
"Project Team Members | 6",
"Project Team Members | 7",
"Project Team Members | 8",
];
// Table
<HotTable
data={[
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
]}
licenseKey="non-commercial-and-evaluation"
manualRowResize
manualColumnResize
height="auto"
minCols={5}
columnHeaderHeight={[50, 50, 50, 50, 50]}
nestedHeaders={colHeaders}
rowHeaderWidth={200}
stretchH={"all"}
rowHeaders={rowsHeaders}
rowHeights={"40px"}
className={"htMiddle my-2 powerInterestGrid_Table"}
afterGetColHeader={function (col, TH) {
TH.className = "htMiddle";
}}
afterGetRowHeader={function (row, TH) {
TH.className = "htMiddle";
}}
/>
// Button
<Button
variant=""
className="btn btn-success wd-10p mt-4 mb-3"
onClick={() => {}}
>
Add new member
</Button>
How can this be done?
Thank you!