簡體   English   中英

在GWT中等待CellTable的數據

[英]Waiting for data for CellTable in GWT

我正在將GWT 2.4與RequestFactory機制一起使用。 隨着data量的增加,填充單元celltables需要一些額外的時間(1-2 sec) 在此期間, celltable為空,用戶不知道是否會出現任何內容。 有什么方法可以為celltables的時間啟用等待indicator嗎?

我已經為RequestFactory調用配置了等待指示器,所以已經為它准備了images ,但是我不知道該怎么做。

謝謝。

您可以使用CellTable的setLoadingIndicator API-

cellTable.setLoadingIndicator( Your customised loading indicator widget );

小部件可以是面板中包裹的圖像,也可以只是圖像。

如果您使用的是ListDataProvider,則需要編寫更多行。 當您執行addDataDisplay方法時,它會在內部將行計數更新為0。使用此方法,表的狀態將更改為Loaded。 因此,我們沒有得到加載圖像。

解決方法是,僅在dataProvider.setList調用之前執行addDataDisplay方法調用。

在調用setLoadingIndicator之前,必須調用以下方法

cellTable.setVisibleRangeAndClearData(cellTable.getVisibleRange(),
   true);

暫無
暫無

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

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