gxt 2.2.5中的远程网格过滤器。我无法在gxt网格上执行远程过滤

时间:2016-10-04 07:54:32

标签: grid gxt

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);

1 个答案:

答案 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();