删除CellTable中的所有列 [英] Remove all columns from a CellTable

查看:115
本文介绍了删除CellTable中的所有列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GWT 2.1.0.M3中的CellTable。有removeColumn函数,但没有removeAllColumns或任何东西。由于列是CellTable的私人成员,所以即使我的CellTable的扩展名也可以轻松访问它。现在,我只是将列数I添加,所以我可以记得全部删除它们。任何人都知道更好的方法?

解决方案

我使用这种方式


  1. 计算表的列数

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


  1. 循环并移除第一列 this.getView()。getTbcell()。removeColumn(0);

    );
    }


这就是我们完成的: - )


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 extension 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 :-)

这篇关于删除CellTable中的所有列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆