Hi Isomorphic,
please see this builtInDS-based testcase using 5.1d SNAPSHOT_v10.1d_2015-10-30, where "Manager" is hidden in the list of possible fields (you have to use the field picker in order to show it).
BuiltInDS.java:
This behavior is not in sync with ListGrid.setShowDetailFields-docs that say that
Best regards
Blama
please see this builtInDS-based testcase using 5.1d SNAPSHOT_v10.1d_2015-10-30, where "Manager" is hidden in the list of possible fields (you have to use the field picker in order to show it).
BuiltInDS.java:
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; 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.types.OperatorId; 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("95%"); w.setHeight("95%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle("Hidden ListGridField"); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); { final ListGrid testGrid = new ListGrid(DataSource.get("employees")); testGrid.setCanEdit(true); ListGridField idLGF = new ListGridField("EmployeeId"); ListGridField nameLGF = new ListGridField("Name"); ListGridField managerLGF = new ListGridField("ReportsTo"); SelectItem managerEditItem = new SelectItem("ReportsTo"); managerEditItem.setOptionDataSource(DataSource.get("employees")); managerEditItem.setValueField("EmployeeId"); managerEditItem.setDisplayField("Name"); managerLGF.setEditorProperties(managerEditItem); testGrid.setFields(idLGF, managerLGF, nameLGF); AdvancedCriteria ac = new AdvancedCriteria(new Criterion("Name", OperatorId.STARTS_WITH, "A")); testGrid.fetchData(ac); w.addItem(testGrid); } w.show(); } }
- showDetailFields - Default value is true
- Fields may also be included directly in this component's fields array in which case they will be present regardless of the detail attribute.
Best regards
Blama
Comment