Sabit Veri Tablosunu tanımlarken, satır yüksekliğini rowHeight özelliğini kullanarak belirlersiniz. Ancak, cell
içeriğinin çok büyük olması durumunda statik bir değer (ör., 50 piksel yüksek) ayarlayarak, yükseklik açıkça ayarlandığından kesilir. rowHeightGetter geri arama işlevi olduğunu görüyorum, ancak bu işlevin argümanları herhangi bir alaka düzeyine sahip görünmüyor (belki de aldıkları satır olabilir mi? Ne tür bir anlam ifade eder, ancak belirli bir sütunun verileriyle ilgili hiçbir şey veya cell
).React FixedDataTable duyarlı satır/hücre boyutu
Bu yüzden merak ediyorum, cell
'un içerdiği verilere yanıt veren (hatta bir şekilde) olması için herhangi bir yol var mı?
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')
);
Bu basit bir örnek ama bunu çalıştırdığınızda/eğer, ilk sütunun hücrenin içeriği kesilmiş olur ve içinde bulunan başka ne görmek yasak olduğunu göreceksiniz.
Şimdi bu konuda bir süredir kafamı duvara çarpıyordum ve bana yardımcı olacak hiçbir şey bulamadım. Başka bir şey kullanmam gerektiğini düşünmeye başladım. Herhangi bir ipucu veya tavsiye sunabilir mi?
thnx
, Christoph
Sadece güzel bir cevap vererek emin olmak için bazı temel adımlar sağlarlar. –