That's it. I have a lot of data and I can't know what height should i use. Is there anyway to make height flexible? I've heard about RowHeightGetter, but i don't know how to use it. Can u give me some example? Thank you
Asked
Active
Viewed 410 times
2 Answers
1
Set your rowHeight as normal, but also set a rowHeightGetter. Below is an example of setting row height as a function of the length of some array in our row. Another example would be using the length of some string to set row height.
<ResponsiveFixedDataTable
headerHeight={50}
rowsCount={data.length}
rowHeight={66}
rowHeightGetter={(rowIndex) => Math.max(66, data[rowIndex][2].length * 22)}
>

user2827377
- 1,381
- 2
- 16
- 26
-
Thanks for example. It would be better if the calculated was based off the field that has the most characters. – Learner Sep 29 '16 at 04:35
0
Use offsetHeight
of an element wrapping you cell content, instead of char count to be more precise.

Oleg Saidov
- 59
- 3