2013-04-23 19 views
0

考慮:在gwt中,計算celltable中行總數的最簡單代碼是什麼?

CellTable<List<String>> table = new CellTable<List<String>>(); 
ListDataProvider<List<String>> dataProvider = new ListDataProvider<List<String>>(); 
dataProvider.addDataDisplay(table); 
List<List<String>> list = dataProvider.getList(); 

是什麼在celltable計算總行的最簡單的代碼?

回答

1

如果getRowCount不工作搞定了,你爲什麼不嘗試獲得排列U具有的大小,你必須推在celltable中的一些數組,爲什麼不只是獲得數組的大小..

+0

thax,我做到了,但它是奇怪的表或simplepager沒有獲取總行的函數。 – Tom 2013-04-23 12:59:38

0

getRowCount() ??

,獲取所有行的總數。

getVisibleItemCount()

獲取顯示可見項目的數量。請注意,如果沒有足夠的數據填充頁面,該值可能會小於頁面大小。

,也看到它返回range oobject方法getVisibleRange(),然後你可以通過range.getLength()

+0

它顯示爲0 getRowCount – Tom 2013-04-23 04:22:33

相關問題