Select 对话框没有加载更多数据

Select dialog does not load more data

我有一个 select 对话框。出于性能原因,在 2000 条总记录中,我一直将阈值增加为 100 条记录。

因此,当弹出窗口打开时,用户可以看到 100 条记录。我写了 growingScrollToLoad 以便当用户向下滚动时,另外 100 条记录被加载。

但是,这不知何故不起作用。 Popover 最初只显示 100 条记录,即使我向下滚动它也不会加载更多数据。我不确定我做错了什么。我曾尝试使用 SAPUI5 Guidelines. Also, it works in https://sapui5.hana.ondemand.com/#/sample/sap.m.sample.SelectDialog/preview

中描述的所有 tags/properties
<SelectDialog confirm="handleConfirm" 
              growingThreshold="100" 
              growingScrollToLoad="true" 
              items="{myModel>/AllData}"
              multiSelect="true" 
              noDataText="No data" 
              liveChange="handleSearchOnDialog" 
              title="Choose" 
              autoAdjustWidth="true">

    <StandardListItem id="idItemA" 
                      description="{Name}" 
                      iconDensityAware="false" 
                      iconInset="false" 
                      title="title" 
                      type="Active"/>
</SelectDialog>

请看API: https://sapui5.hana.ondemand.com/#/api/sap.m.SelectDialog

您会注意到 growingScrollToLoad 未列在 sap.m.SelectDialog 的 属性 部分 ==> 您无法使用此功能

属性 growingScrollToLoadsap.m.ListBase 的 属性。因此,如果您想使用它,您需要创建一个自定义对话框,其中包含 sap.m.Listsap.m.ListBase 的任何其他子项作为内容。
sap.m.SelectDialogsap.ui.core.Control 的直接子代 -> 与 sap.m.ListBase 没有直接关系)

我找到了不改变控制的解决方案。

在 XML 文件中,我提供了 growingThreshold="100" growing="true" 到 Select 对话框。在控制器文件中,对于 Select 对话框的 onOpen 事件,我编写了这段代码:

var sGrowingThreshold = this._oSelectDialog.getGrowingThreshold(); //sGrowingThreshold will be 100

if (sGrowingThreshold) 
       {
                this._oSelectDialog.setGrowing(sGrowingThreshold);
       }

每当我向下滚动到最后时,它都能正常工作并加载数据。