Closed progenysw closed 2 years ago
The library defers the job of rendering cells to the consumer code - you can attach an onClick
listener to the wrapper node returned by your custom cell rendering function to achieve this.
E.g.:
<TreeTable
value={treeValue}
onChange={handleOnChange}>
<TreeTable.Column
renderCell={(row) => <span onClick={(e) => { console.log("Click on row:", row, e); }}>{row.data.name}</span>}
// ^ used to render all cells corresponding to the "Name" column
renderHeaderCell={() => <span>Name</span>}/>
<TreeTable.Column
renderCell={(row) => <span onClick={(e) => { console.log("Click on row:", row, e); }}>{row.data.employees}</span>}
// ^ used to render all cells corresponding to the "Employees" column
renderHeaderCell={() => <span>Employees</span>}/>
...
</TreeTable>
I can't find anything in the doc to trap[ and onclick for a specific row"