我的问题很简单,但不容易做到。我需要p-dataTable->中所有行的高度,例如在数组中。可以达到所有高度吗?
答案 0 :(得分:0)
尝试一下,它对我有用!
::ng-deep .your-table .ui-datatable-scrollable-view .ui-datatable-scrollable-body {
min-height: 27vh;
}
答案 1 :(得分:0)
我用这个得到结果:
let rowHeights = document.getElementsByClassName("ui-datatable-tablewrapper");
let rowHeightsFiltered = rowHeights[0].children[0].children[1].children;
然后我将值放入数组:
let eacheRowHeight = new Array;
for (let i = 0; i < rowHeightsFiltered.length; i++) {
eacheRowHeight.push(rowHeightsFiltered[i].clientHeight);
}