StringFilter reportNameFilter=new StringFilter("reportName");
StringFilter categoryFilter=new StringFilter("category");
GridFilters gridFilters=new GridFilters();
gridFilters.setLocal(true);
gridFilters.addFilter(categoryFilter);
gridFilters.addFilter(reportNameFilter);
grid = new Grid<BeanModel>(store, columns);
grid.setWidth(550);
grid.setHeight(320);
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.addPlugin(gridFilters);
答案 0 :(得分:0)
我们可以为网格过滤器覆盖Events.Deactivate和Events.Activate。 并使用页面大小BasePagingLoader重新配置网格
pagingToolBar.setPageSize(getReportNames().size());
pagingToolBar.bind(loader);
loader.load(0, getReportNames().size() );
tempProxy = new PagingModelMemoryProxy(store.getModels());
tempLoader = new BasePagingLoader<PagingLoadResult<BeanModel>>(tempProxy);
tempLoader.setRemoteSort(true);
tempStore = new ListStore<BeanModel>(tempLoader);
pagingToolBar.setPageSize(Integer.parseInt(listbox.getValue(listbox.getSelectedIndex())));
pagingToolBar.bind(tempLoader);
tempLoader.load(0, Integer.parseInt(listbox.getValue(listbox.getSelectedIndex())));
grid.reconfigure(tempStore, buildColumnModel());
pagingToolBar.refresh();