-1

In GWT on every column header there are four options - sort ascending, descending, columns, filters. I want to display only filter option and hide all other options. To disable completely I can do column.setMenuDisabled(true). How do I disable partial header items?

Also I want to know how to mask grid when data is getting filtered in client side. grid.setloadmask does not help since filtering is done at client side.

Code snippet used to display column header:

ColumnConfig myColumn = new DefaultColumnConfig("name", "name", 92, true);
        myColumn.setAlignment(HorizontalAlignment.LEFT);
        myColumn.setRenderer(new GridCellRenderer<ModelData>() {

            @Override
            public Object render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex,
                    ListStore<ModelData> store, Grid<ModelData> grid) {
                return ClientUtils.getTextToolTip(model.get("name").toString());
            }
        });
           myColumn.setMenuDisabled(false); 

setMenuDisabled when set false displays all four options (sort ascending/ sort descending/columns/filters) in column header. I want only filter to be visible.
The commponent am using is GXT - com.extjs.gxt.ui.client.widget.grid.ColumnConfig. How do I get control over these menuitems of column?

Adam
  • 5,403
  • 6
  • 31
  • 38
  • Please include samples of what you've tried thus far. – mmmmmpie Feb 06 '15 at 14:40
  • 1
    There no such things like "filters" and "hide all" on stock GWT components. Please precise which 3rd-party widget library you're using (SmartGWT? GXT?) – Thomas Broyer Feb 06 '15 at 14:54
  • The `setMenuDisabled` method can be found in gxt. What you could do is iterate the menu and disable the menuitems you don't want based on their text. It's a hack but it will work. These filters are generated automatically based on the type of the column (string, date, etc.) and I believe the library doesn't provide a way of disabling them partially. GXT is wonderful as long as you don't need anything outside the box. If you do, then be prepared for a lot of frustration. – Alkis Kalogeris Feb 06 '15 at 15:18
  • How do I get the menuitems of column header? – lavanya muthu Feb 10 '15 at 11:50

1 Answers1

0

For each column config, set as follows:

columnConfig.setSortable(false);
columnConfig.setHideable(false);
udeleng
  • 866
  • 2
  • 14
  • 20