开发者

Remove all columns from a CellTable

开发者 https://www.devze.com 2023-01-17 08:50 出处:网络
I\'m using a CellTable from GWT 2.1.0.M3.There are removeColumn functions, but no removeAllColumns or anything.Since \"columns\" is a private member of CellTable, not even my exte开发者_StackOverflow社

I'm using a CellTable from GWT 2.1.0.M3. There are removeColumn functions, but no removeAllColumns or anything. Since "columns" is a private member of CellTable, not even my exte开发者_StackOverflow社区nsion of CellTable can easily access it.

For now, I'm just storing the number of columns I add so I can remember to remove them all. Anyone know a better way?


I am using this way

  1. Take count of columns of table

int count = this.getView().getTbcell().getColumnCount();

  1. Loop through and remove first column

    for(int i=0;i<count;i++){ this.getView().getTbcell().removeColumn(0); }

Thats it we are done :-)


while (cellTable.getColumnCount() > 0) {
    cellTable.removeColumn(0);
}


This might not be what your looking for but it works for me:

getCellTable().setVisibleRange(0, 0);
listViewAdapter.updateRowData(0, result);
getCellTable().setVisibleRange(0, 10);
0

精彩评论

暂无评论...
验证码 换一张
取 消