如何获得正确的行数?

问题描述

SmartTable的ShowRowCount仅在滚动到表的最后一个条目时显示正确的行数。 如果行数小于100,则结果正确。 如果行数大于100,例如304,则初始结果为100。现在,如果我滚动到底部并触发rowningScrollToLoad,结果是200。我必须滚动两次到底部并触发rowingScrollToLoad才能看到正确的结果304。

<smartTable:SmartTable id="smartResult" entitySet="someSet" tableType="ResponsiveTable" useExportToExcel="false"
                                useVariantManagement="false" useTablePersonalisation="true" header="Result" showRowCount="true"
                                persistencyKey="SmartTableAnalytical_Explored" enableAutoBinding="false" class="sapUiResponsiveContentPadding"
                                initiallyVisibleFields="Some Field Names"
                                ignoredFields="Some other Field Names"
                                requestAtLeastFields="InternalID">

    <Table id="tableResult" noDataText="{i18n>noData}" growingThreshold="50" mode="Single" sticky="ColumnHeaders" growing="true" growingScrollToLoad="true">

有人有想法吗?

解决方法

oData协议已经传输了此信息。 oData向后端系统发出新的异步获取请求以获取总数,以获取此信息。下面是示例总计数请求。

https://services.odata.org/V2/Northwind/Northwind.svc/Orders/$count