IButton searchButton = new IButton("Filter");
searchButton.setAutoFit(true);
searchButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Criterion criteria = rangeItem.getCriterion();
grid1.fetchData(criteria);
}
});
layout.addMember(searchButton);
layout.addMember(grid1);
// ---------------------------------------------------------------------------------------
// Inline FilterEditor Example (MiniDateRangeItem)
Label filterEditorLabel = new Label("FilterEditor (MiniDateRangeItem)");
filterEditorLabel.setWidth(595);
filterEditorLabel.setBaseStyle("exampleSeparator");
filterEditorLabel.setHeight(25);
layout.addMember(filterEditorLabel);
// Create a ListGrid displaying data from the worldDS and also displaying a FilterEditor
final ListGrid grid2 = new ListGrid();
grid2.setWidth(595);
grid2.setHeight(200);
grid2.setDataSource(WorldXmlDS.getInstance());
grid2.setAutoFetchData(true);
grid2.setShowFilterEditor(true);
layout.addMember(grid2);
layout.addDrawHandler(new DrawHandler() {
@Override
public void onDraw(DrawEvent event) {
Criterion criteria = rangeItem.getCriterion();
grid1.fetchData(criteria);
}
});
return layout;