Hi, I thought of continuing on the same thread regarding my problem and please guide me if i have posted it in wrong place.
I am very new to ext GWT and recently i wrote a Grid filter code which does not seems to be working. The data on the Grid is not getting filtered after I enter the "text" inside the Filter textbox (provided on column header) and press Enter key.
Following is the code present inside the onRender method of my LayoutContainer class. Please guide me If i have done any mistakes
Code:
super.onRender(parent, index);
setLayout(new FlowLayout(10));
getAriaSupport().setPresentation(true);
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
GridFilters filters = new GridFilters();
ColumnConfig column = new ColumnConfig();
column.setId("name"); // String value
column.setHeader(" Name");
column.setWidth(100);
configs.add(column);
column = new ColumnConfig();
column.setId("company"); //String value
column.setHeader("Company");
column.setWidth(100);
column.setRowHeader(true);
configs.add(column);
StringFilter cFilter = new StringFilter("company");
filters.addFilter(cFilter);
column = new ColumnConfig();
column.setId("dept");
column.setHeader("Department");
column.setAlignment(HorizontalAlignment.RIGHT);
column.setWidth(100);
configs.add(column);
StringFilter dFilter = new StringFilter("dept");
filters.addFilter(dFilter);
store = new ListStore<ModelData>();
store.add(Util.getData()); //Util.getData gives List<ModelData> object
ColumnModel cm = new ColumnModel(configs);
ContentPanel cp = new ContentPanel();
cp.setBodyBorder(true);
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.setSize(380, 100);
final Grid<ModelData> grid = new Grid<ModelData>(store, cm);
grid.setStyleAttribute("borderTop", "none");
grid.setAutoExpandColumn("name");
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.setColumnReordering(true);
grid.getView().setForceFit(true);
grid.addPlugin(filters);
grid.getAriaSupport().setLabelledBy(cp.getHeader().getId() + "-label");
cp.add(grid);
add(cp,new FlowData(0));
setSize(400, 150);