Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

client-side filtering

$
0
0
I have a list grid that gets all its data using a custom DMI. I set it up to use client-side filtering. I also have a refresh button that forces an update from the server. However, when I click refresh, the filter I had previously typed into the grid's filter editors have no effect on the returned data. I tried setting a timer and adding a data arrived handler to filter the data but both didn't work. I had previously had a fetch callback which called filterData and that worked, but I had to use invalidateCache to force an update. Any thoughts? Thanks!

Paraphrased code:
Code:

ResultSet rs = new ResultSet();
rs.setUseClientSideFiltering(true);
// tried adding data arrived handler here but didnt work

final ListGrid grid = new ListGrid();
// ... set up other attributes
grid.setShowFilterEditor(true);
grid.setFilterOnKeypress(true);
grid.setDataProperties(rs);

Button b = new Button("refresh");
b.addClickHandler(new ClickHandler() {
  boolean first = true;
  public void onClick() {
    Criteria filterCriteria = grid.getFilterEditorCriteria();
    if (first) {
      grid.fetchData();
      first = false;
    } else {
      grid.invalidateCache();
      // tried creating timer here and calling grid.filterData(filterCriteria) but nothing happened
    }
  }
}

SmartGWT 4.0p 2014-01-15. FF 26. GWT 2.5.1

Viewing all articles
Browse latest Browse all 4756

Trending Articles