Hi Isomorphic,
please see this video (v11.1p_2018-02-16) where you can see many unexpected requests when filtering for the 1st time - subsequent filtering seems to work w/o server contact.
As the loaded ListGrid has already all records of the ResultSet, I'd expect no further requests.
Also, I'd expect to see column ReportsTo as I'm setting employeesGrid.setShowDetailFields(true).
This is the BuiltInDS based testcase (BuiltInDS.java file only):
Best regards
Blama
please see this video (v11.1p_2018-02-16) where you can see many unexpected requests when filtering for the 1st time - subsequent filtering seems to work w/o server contact.
As the loaded ListGrid has already all records of the ResultSet, I'd expect no further requests.
Also, I'd expect to see column ReportsTo as I'm setting employeesGrid.setShowDetailFields(true).
This is the BuiltInDS based testcase (BuiltInDS.java file only):
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criterion; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.types.SortDirection; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS implements EntryPoint { private VLayout mainLayout; private IButton recreateBtn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); mainLayout = new VLayout(20); mainLayout.setWidth100(); mainLayout.setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(); } }); mainLayout.addMember(recreateBtn); recreate(); mainLayout.draw(); } private void recreate() { Window w = new Window(); w.setWidth(400); w.setHeight(350); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("Client side filtering issues unexpected requests" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); final ListGrid employeesGrid = new ListGrid(DataSource.get("employees")); employeesGrid.setHeight100(); employeesGrid.setAutoFetchData(false); employeesGrid.setCanEdit(true); employeesGrid.setShowFilterEditor(true); employeesGrid.setFilterOnKeypress(true); [B] employeesGrid.setShowDetailFields(true);[/B] ListGridField employeeId = new ListGridField("EmployeeId"); ListGridField name = new ListGridField("Name"); ListGridField gender = new ListGridField("Gender"); ListGridField reportsTo = new ListGridFieldReportsTo("ReportsTo"); ListGridField job = new ListGridField("Job"); employeesGrid.setFields(employeeId, name, gender, reportsTo, job); employeesGrid.setSort(new SortSpecifier[] { new SortSpecifier(name.getName(), SortDirection.ASCENDING) }); employeesGrid.fetchData(new AdvancedCriteria(new Criterion(name.getName(), OperatorId.STARTS_WITH, "A"))); w.addItem(employeesGrid); w.show(); } private class ListGridFieldReportsTo extends ListGridField { public ListGridFieldReportsTo(String name) { super(name); SelectItem managerCBI = new SelectItem(); managerCBI.setOptionDataSource(DataSource.get("employees")); managerCBI.setValueField(DataSource.get("employees").getPrimaryKeyFieldName()); managerCBI.setDisplayField("Name"); managerCBI.setPickListSort(new SortSpecifier[] { new SortSpecifier("EmployeeId", SortDirection.ASCENDING), new SortSpecifier("Name", SortDirection.ASCENDING) }); ListGridField managerCBI_empIdLGF = new ListGridField("EmployeeId"); ListGridField managerCBI_nameLGF = new ListGridField("Name"); managerCBI.setPickListFields(managerCBI_empIdLGF, managerCBI_nameLGF); managerCBI.setPickListHeaderHeight(0); // setMultiple(true); setFilterEditorProperties(managerCBI); } } }
Blama
Comment