GXT How to refresh local dataset when filter is re

2020-04-20 23:49发布

问题:

I have a local Grid with a set of columns & filters. When I specify filter criteria (via header dropdown menu), the rows displayed is a subset of the entire store.

When I remove a filter, the header dropdown menu is updated correctly to omit the criteria dialog. But the rows displayed are not un-filtered.

How do I trigger a recalculation when the filter is removed?


It is as simple as this:

public class ReloadableGridFilters<T> extends GridFilters<T> {
/**
 * extended to call the reload()
 * @see com.sencha.gxt.widget.core.client.grid.filters.AbstractGridFilters#removeFilter(com.sencha.gxt.widget.core.client.grid.filters.Filter)
 */
@Override
public void removeFilter(Filter<T, ?> filter) {
    super.removeFilter(filter);
    reload();       
}

回答1:

After removing filters, for loading previous data we must override protected void reload() {} method of GridFilters



标签: gxt