When defining your fixed data table, you specify the row height using the rowHeight property. But by setting a static value (for example, 50 pixels high), if the contents of this cell too large, it is cropped because the height is explicitly set. I see that there is a rowHeightGetter callback function, but the arguments to this function do not have any relevance (maybe it can be the row that it receives? What type makes sense, but does not contain data for a specific column or cell ).
So I'm curious if there is a way to make cell (at least a little) respond to the data 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') );
This is a simple example, but if / when you run it, you will see that the contents of the first cell of the column are disabled and you are not allowed to see what else is inside.
I already hit my head against the wall on this issue and did not find anything that could help me. I'm starting to think that I need to use something else. Can anyone offer any advice or advice?
Thnx, Christoph
javascript reactjs fixed-data-table
Christoph
source share