2

I would like to remove the sorting arrow from a header of a CellTable. (the one in the red circle below, which is from the GWT showcase : http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellTable)

arrow celltable

But I still want the sorting capabilities of the CellTable.

Is it possible? Any idea?

xavier.seignard
  • 11,254
  • 13
  • 51
  • 75

2 Answers2

7

Untested and probably a bit of a hack, but you could try overriding the default style to return blank images. Extend Hilbrand's earlier solution to override the ImageResources that the CellTable uses:

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

    @Source("blank.jpg")
    ImageResource cellTableSortDescending();
 }

Create 'blank.jpg' and put it in the same resources package as this interface.

Community
  • 1
  • 1
Capn Sparrow
  • 2,030
  • 2
  • 15
  • 32
  • 2
    Thanks! Worked as expected! But the methods are the following : `public ImageResource cellTableSortAscending();` and `public ImageResource cellTableSortDescending();` Anyway, thanks for your help. – xavier.seignard Mar 10 '12 at 16:00
  • 1
    People looking for a corresponding solution for DataGrid (instead of CellTable): use the methods "public ImageResource dataGridSortAscending();" and "public ImageResource dataGridSortDescending();" – David Hermanns Nov 22 '17 at 10:42
-2

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

removes the sorting arrow

Andreas
  • 1
  • 3