When defining your Fixed Data Table, you specify your row height using the rowHeight property. But by setting a static value (e.g., 50 pixels high) if the content of that cell
is too large, it gets cut off because the height is explicitly set. I see that there is a rowHeightGetter callback function but the arguments to that function don't appear to have any relevancy (perhaps it might be the row it's getting? Which kind of makes sense but nothing about the data for the particular column or cell
).
So I'm curious, is there any way to make it so that the cell
is (even somewhat) responsive to the data that it contains?
var Table = FixedDataTable.Table,
Column = FixedDataTable.Column,
Cell = FixedDataTable.Cell;
var rows = [
['a1', 'b1', 'c1'],
['a2', 'b2', 'c2'],
['a3', 'b3', 'c3'],
// .... and more
];
ReactDOM.render(
<Table
rowHeight={50}
rowsCount={rows.length}
width={500}
height={500}
headerHeight={50}>
<Column
header={<Cell>Col 1</Cell>}
cell={<Cell>Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content Column 1 static content </Cell>}
width={200}
/>
<Column
header={<Cell>Col 3</Cell>}
cell={({rowIndex, ...props}) => (
<Cell {...props}>
Data for column 3: {rows[rowIndex][2]}
</Cell>
)}
width={200}
/>
</Table>,
document.getElementById('CustomDataTable1')
);
It's a simple example but if/when you run it, you'll see that the contents of the first column's cell gets cut off and you aren't allowed to see what else is contained within.
I've been beating my head against the wall on this issue for a while now and haven't found anything that will help me. I'm starting to think that I need to use something else. Could anyone offer any tips or advice?
thnx, Christoph