【问题标题】:GWT CellTable - Remove the sorting arrow from a headerGWT CellTable - 从标题中删除排序箭头
【发布时间】:2012-03-09 18:14:57
【问题描述】:

我想从 CellTable 的标题中删除排序箭头。 (下图红圈内,来自 GWT 展柜:http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellTable

但我仍然想要 CellTable 的排序功能。

有可能吗?有什么想法吗?

【问题讨论】:

    标签: java gwt


    【解决方案1】:

    未经测试,可能有点破解,但您可以尝试覆盖默认样式以返回空白图像。扩展 Hilbrand's earlier solution 以覆盖 CellTable 使用的 ImageResources:

    public interface TableResources extends CellTable.Resources {
        @Source("blank.jpg")
        ImageResource cellTableSortAscending();
    
        @Source("blank.jpg")
        ImageResource cellTableSortDescending();
     }
    

    创建'blank.jpg'并与本界面放在同一个资源包中。

    【讨论】:

    • 谢谢!按预期工作!但方法如下:public ImageResource cellTableSortAscending();public ImageResource cellTableSortDescending(); 无论如何,谢谢你的帮助。
    • 人们正在寻找 DataGrid(而不是 CellTable)的相应解决方案:使用方法“public ImageResource dataGridSortAscending();”和“public ImageResource dataGridSortDescending();”
    【解决方案2】:

    getDataGrid().getColumnSortList().clear();

    删除排序箭头

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-10
      • 1970-01-01
      • 1970-01-01
      • 2011-12-06
      相关资源
      最近更新 更多