1
我的過濾器不重新加載網格,但「排序升序」,「降序排序」和「列」工作良好。我用這個教程,但是這個演示的過濾器無法正常工作或:http://www.sencha.com/examples-2/#filtergridgxt 2.3網格過濾器不工作
我的代碼在onModuleLoad()
:
configs = new ArrayList<ColumnConfig>();
column = new ColumnConfig("id", "Id", 20);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
column = new ColumnConfig("name", "Név", 50);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
column = new ColumnConfig("address", "Cím", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
column = new ColumnConfig("email", "Első email", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
column = new ColumnConfig("startDate", "Feltöltés", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
column = new ColumnConfig("changeDate", "Módosítás", 100);
column.setAlignment(HorizontalAlignment.LEFT);
configs.add(column);
cm = new ColumnModel(configs);
idFilter = new NumericFilter("id");
nameFilter = new StringFilter("name");
addressFilter = new StringFilter("address");
emailFilter = new StringFilter("email");
startDateFilter = new DateFilter("startDate");
changeDateFilter = new DateFilter("changeDate");
usersListGridFilter=new GridFilters();
usersListGridFilter.setLocal(true);
usersListGridFilter.clearFilters();
usersListGridFilter.addFilter(idFilter);
usersListGridFilter.addFilter(nameFilter);
usersListGridFilter.addFilter(addressFilter);
usersListGridFilter.addFilter(emailFilter);
usersListGridFilter.addFilter(startDateFilter);
usersListGridFilter.addFilter(changeDateFilter);
usersListGridFilter.setAutoReload(true);
usersListGridFilter.setUpdateBuffer(100);
usersClientList= new ListStore<UserClient>();
usersList.add(ClientTestUsers.getUsers());
usersClientListGrid=new Grid<UserClient>(usersClientList, cm);
usersClientListGrid.setStyleAttribute("borderTop", "none");
usersClientListGrid.setAutoExpandColumn("name");
usersClientListGrid.setBorders(true);
usersClientListGrid.setStripeRows(true);
usersClientListGrid.getView().setForceFit(true);
usersClientListGrid.setColumnLines(true);
usersClientListGrid.addPlugin(usersListGridFilter);
usersClientListGrid.setLoadMask(true);
cp = new ContentPanel();
cp.setBodyBorder(true);
cp.setHeadingText("Users");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.setSize(800, 300);
cp.add(usersClientListGrid);
usersListFormPanel = new FormPanel();
usersListFormPanel.add(usersListHorizontalPanel);
usersListFormPanel.add(cp);
usersListFormPanel.setWidth(820);
RootPanel.get("startWindowDiv").add(usersListFormPanel);
http://stackoverflow.com/a/13966581/1211000 – swamy