簡體   English   中英

如何使用TypeScript和Protractor獲取ag網格中的行數

[英]How to get the count of rows in an ag-grid using TypeScript and Protractor

我試圖找到ag網格中存在的行數。 Table結構;看起來像這樣:

<div class="ag-body-container" role="presentation" style="height: 500px; top: 0px; width: 1091px;">
<div role="row" row-index="0" row-id="0" comp-id="134" class="ag-row ag-row-no-focus ag-row-even ag-row-no-animation ag-row-level-0" style="height: 50px; top: 0px;  ">
<div role="row" row-index="1" row-id="1" comp-id="140" class="ag-row ag-row-no-focus ag-row-odd ag-row-no-animation ag-row-level-0" style="height: 50px; top: 50px;  ">
<div role="row" row-index="2" row-id="2" comp-id="146" class="ag-row ag-row-no-focus ag-row-even ag-row-no-animation ag-row-level-0" style="height: 50px; top: 100px;  ">
<div role="row" row-index="3" row-id="3" comp-id="152" class="ag-row ag-row-no-focus ag-row-odd ag-row-no-animation ag-row-level-0" style="height: 50px; top: 150px;  ">
<div role="row" row-index="4" row-id="4" comp-id="158" class="ag-row ag-row-no-focus ag-row-even ag-row-no-animation ag-row-level-0" style="height: 50px; top: 200px;  ">


在其他div下,幾乎沒有更多的行具有相同的class="ag-row ag-row-no-focus ag-row-odd ag-row-no-animation ag-row-level-0" 所以我不能直接用此類搜索行。

感謝任何形式的幫助。

試試這個css選擇器div.ag-body-container > [role="row"] ,它只計算當前視口中的行。 我注意到ag-Grid上的演示,當您向下滾動網格時,將顯示另一個批處理行。 因此,如果網格也與此類似,則css選擇器上方將無法獲取視口中不可見的所有數據行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM