固定データ テーブルを定義するときは、rowHeightプロパティを使用して行の高さを指定します。ただし、コンテンツが大きすぎる場合に静的な値 (たとえば、高さ 50 ピクセル) を設定するcell
と、高さが明示的に設定されているため、コンテンツが切り取られます。rowHeightGetterコールバック関数があることがわかりますが、その関数への引数には関連性がないようです (おそらく、それが取得している行である可能性がありますか?特定の列またはのデータについては何も意味がありませんcell
)。
だから私は興味がありcell
ます、それが含まれているデータに(多少でも)反応するようにする方法はありますか?
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')
);
これは簡単な例ですが、実行すると、最初の列のセルの内容が切り取られ、その中に何が含まれているかを確認できないことがわかります。
私はしばらくの間、この問題について壁に頭をぶつけてきましたが、私を助けるものは何も見つかりませんでした. 何か他のものを使用する必要があると考え始めています。誰でもヒントやアドバイスを提供できますか?
thnx、クリストフ